Date: Mon, 29 May 2006 04:43:47 -0400
Reply-To: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <ghellrieg@T-ONLINE.DE>
Subject: Re: Creating a variable 'Count'
in a DATA step you have the automatic variable _n_ with a kind of
observation counter. This varioable is not stored in the dataset, but you
can assign it to a variable which is:
counter = _n_;
On Mon, 29 May 2006 04:11:34 -0400, Ankur Shanker
>Hi SAS users,
>My request will seem to be pretty simple but bear with me as I have only
>recently started using SAS.
>Anyways, i want to create a variable 'count', which will hold the count of
>the number of observations in the data set. Say, i have another
>variable 'sessionid' and i want to count all those observations
>sequentially (in another variable count) until the data reaches the end
>i.e. sessionid becomes blank or missing.
>I hope I have made the problem amply clear.
>Thanks and bye