LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 10 Jul 2006 14:31:34 -0700
Reply-To:   "Nordlund, Dan (DSHS)" <NordlDJ@DSHS.WA.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Nordlund, Dan (DSHS)" <NordlDJ@DSHS.WA.GOV>
Subject:   Re: Retaining variable value
Comments:   To: "jeetsm@gmail.com" <jeetsm@GMAIL.COM>
Content-Type:   text/plain; charset=utf-8

> -----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


Back to: Top of message | Previous page | Main SAS-L page