Date: Thu, 20 Apr 2006 09:09:27 GMT
Reply-To: Eric Eyre <eeyre@CONCENTRIC.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Eric Eyre <eeyre@CONCENTRIC.NET>
Organization: Road Runner High Speed Online http://www.rr.com
Subject: Re: Can we use embedded data step
it seems as if a lot of SAS-Lers are heavily into embedding, but the variety
I see here is embedding SET or INFILE/INPUT statements within DO loops as in
data answer;
if _n_=1 then do until (lastobs);
set monthsum end=lastobs;
totalrev+revcargo;
end;
set monthsum;
pctrev=revcargo/totalrev;
OR
data quarter;
monthnum=month(today());
midmon=month(intnx('month',today(),-1));
lastmon=month(intnx('month',today(),-2));
do i = monthnum, midmon, lastmon;
nextfile="c:\sasuser\month"!!compress(put(i,2.)!!".dat",' ');
do until (lastobs);
infile temp filevar=nextfile end=lastobs;
input Flight $ Origin $ Dest $ Date : date9.
output;
end;
end;
stop;
"Rajesh" <Rajesh.vishwanath@gmail.com> wrote in message
news:1145519350.081452.96350@g10g2000cwb.googlegroups.com...
> Hi all,
>
>
> Just i was thinking ,can we use embedded datastep in SAS.
> That is within a datastep can we use another datastep.(i don't so it is
> there).
> But if is there can you let me know it would be a help for me.
>
> Thanks,
> Rajesh.
>
|