| Date: | Wed, 12 Jan 2011 12:05:51 -0500 |
| Reply-To: | Jérôme <jerome.masset@CEGEDIM.FR> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Jérôme <jerome.masset@CEGEDIM.FR> |
| Subject: | Re: Continuous NUmbers |
|---|
On Tue, 11 Jan 2011 14:58:54 -0500, John Mike <sasslick@GMAIL.COM> wrote:
>How can we generate continous numbers for var seq=1,2,3...unitl end of
>observations
>I need to use retain.
>Thanks
>john
with retain :
data test3;
set sashelp.zipcode;
retain rnum;
rnum = sum(rnum, 1);
/* or
rnum+1;
*/
run;
other ways :
data test1;
set sashelp.zipcode;
rnum = monotonic();
run;
data test2;
set sashelp.zipcode;
rnum = _n_;
/* care of by processing */
run;
|