Date: Tue, 11 Jan 2011 20:29:23 +0000
Reply-To: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/OCOO/ITSO)" <rjf2@CDC.GOV>
Subject: Re: Continuous NUmbers
In-Reply-To: <AANLkTimo1+PeHjQh00qLo6j=bOmCKXxkjFZWEvpTfXm+@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
From: John Mike
Sent: Tuesday, January 11, 2011 2:59 PM
Subject: Continuous NUmbers
How can we generate continous numbers for var seq=1,2,3...unitl end of
observations
I need to use retain.
Thanks
john
to assure that you have one as start and Number-of-rows as your high-value
use this program.
Note: Nrows is an _automatic_ variable and is not saved.
DATA Work.NumberedRows;
do RowNmbr = 1 to Nrows;
set SAShelp.Class
nobs = Nrows;
output;
end;
stop;
Proc Print data = &SysLast.;
run;
compare to:
DATA Work.NumberedRowsX;
retain RowNmbr 0;
do until(EndoFile);
set SAShelp.Class
end = EndoFile;
RowNmbr+ +1;*increment RowNmbr;
output;
end;
stop;
Proc Print data = &SysLast.;
run;
Ron Fehd the unique RowId maven