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 (July 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 15 Jul 2011 18:54:00 -0400
Reply-To:   bbser 2009 <bbser2009@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   bbser 2009 <bbser2009@GMAIL.COM>
Subject:   Re: very interesting! set one two ..., what's make the difference?
Comments:   To: "Data _null_;" <iebupdte@gmail.com>
In-Reply-To:   <CAEZCyssvkscH2GeYt0mdyqtDNoHVKsizWdBD=sbJpV+NAMMbpA@mail.gmail.com>
Content-Type:   text/plain; charset="us-ascii"

How about this interpretation:

When using "set have have2": once SAS detects the end of have, it erases PDV and continues to have2. When using "set have have2 nobs=_nobs point=_point;": There is no way for SAS to detect the end of have, so the value 3 got retained when SAS is processing the case when _nobs=4.

Max (Maaxx)

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Data _null_; Sent: July-15-11 6:17 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: [SAS-L] very interesting! set one two ..., what's make the difference?

On Fri, Jul 15, 2011 at 4:37 PM, Jim Groeneveld <jim.1stat@yahoo.com> wrote: > Need2 is a concatenation of both datasets Have and Have2, generated from the > implicit data step iteration that sets every variable, NOT occurring in a > dataset read, to missing for each new record. Only dataset variables are > automatically retained; hence the result in Need2.

The way I understand what you say then the result of this code, shown below, NUM=99 should only be on first obs from HAVE2, but that is not the case. I don't know a good way to explain it but I don't think you have either.

data need2; retain flag 1; set have(in=in1) have2(in=in2); if in2 and flag then do; num = 99; flag = 0; end; run; proc print data=need2; run; Obs flag num num2

1 1 1 . 2 1 3 . 3 0 99 4 4 0 99 5


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