Date: Tue, 2 Nov 1999 17:46:06 +0000
Reply-To: Douglas Nichols <dnichols@FHCRC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Douglas Nichols <dnichols@FHCRC.ORG>
Organization: National Wilms Tumor Study Group
Subject: Re: looping over a set statement?
Content-Type: text/plain; charset=us-ascii
California Doll wrote:
>
> Douglas,
> I have an idea of what you are trying to do. I will give you some logic
> and see if this helps.
>
> 1. get a dataset that contains all ids you wish to process (IDS)
> 2. get the number of ids that will be processed and store in a macro
> variable (call symput('n_ids',nobs) ).
> 3. write a macro that does a %do from 1 to &n_ids
...snip...
> Vicki
> --
> California Doll
So how about something like this....
data _null_;
set myfile1(keep=id);
call execute('%let thisId='||put(id,f5.)||';');
do while(not(lastone));
set myfile2(where=(id=&thisId));
put "Some myfile2 stuff";
end;
run;
although this doesn't work just like either of my previous examples.
...snip...
> I want to do the following
> > data junk;
> > set myjunk(keep=id var1);
> > put '************' id;
> > do while(not(lastone));
> > set yourjunk(keep=id var2 var3 where=(yourjunk.id = myjunk.id))
> > end=lastone;
> > put @5 var2 +3 var3;
> > end;
> > run;
> >
> > How is myjunk.id differentiated by yourjunk.id..., the sytax above is
> > not correct.
> >
--
Cheers, dn
Douglas Nichols dnichols@fhcrc.org
---------------------------------------------------------------
National Wilms Tumor Study Group 206.667.4283
Seattle, WA