|
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> jeetsm@gmail.com
> Sent: Monday, July 10, 2006 1:42 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Retaining variable value
>
> I merged two datasets and then I output those which doesnt match in one
> dataset for example
> if ina and ^inb then do
> count = count + 1;
> end:
> run;
> ...
> ....
> num = 0; // created outside data step is it possible
> do until (num < count)
>
> Will the value of count be retained from above and num be used in the
> loop below
>
> Thanks
You really haven't provide sufficient information for anyone to give you a
reasonable answer to your question. One good way to explore these kinds of
issues when you are just beginning is to create some test data, run your
code, and see what happens. But in the snippet of code you show above,
unless you have included the variable COUNT in a RETAIN statement that you
haven't shown, you will not be counting anything. Also, if COUNT already
exists in the dataset you are reading, your statement will not work like you
probably expected.
If you write back to SAS-L and show what you are trying to accomplish,
including test data, program code, and desired output data, someone may be
able to help you.
Dan
Daniel J. Nordlund
Research and Data Analysis
Washington State Department of Social and Health Services
Olympia, WA 98504-5204
|