LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Tue, 14 Dec 1999 10:17:28 -0800
Reply-To:   Robert Virgile <virgile@MEDIAONE.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Robert Virgile <virgile@MEDIAONE.NET>
Subject:   Re: How to include missing values on Update
Content-Type:   text/plain; charset=us-ascii

As a previous poster mentioned, MERGE instead of UPDATE may be helpful ... but not if you have many transactions per ID.

UNTESTED: I believe that UPDATE respects special missing values. This combination might work:

data trans; set trans; array nums {*} _numeric_; do i=1 to dim(nums); if nums{i}=. then nums{i}=.R; end; drop i; run;

data master; update master trans; by ID; /* assuming they are sorted */ array nums {*} _numeric_; do i=1 to dim(nums); if nums{i}=.R then nums{i}=.; end; drop i; run;

A couple of notes. First, you don't have to apply this to ALL numerics in the transaction file. It's perfectly all right to pick and choose which should take on a special missing value. And to make this happen for character variables, you might have to come up with your own version of a special missing value for character values, such as "_" or "!". Whatever character you choose, make sure it's only one character long, because some character variables in the master file might be only one character long.

Bob V.


Back to: Top of message | Previous page | Main SAS-L page