Date: Mon, 15 Nov 2004 14:10:46 -0500
Reply-To: "Lustig, Roger" <roger.lustig@CITIGROUP.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Lustig, Roger" <roger.lustig@CITIGROUP.COM>
Subject: Re: SAS Help
Content-Type: text/plain; charset="iso-8859-1"
Sorry, no DO-loops today!
flag=(min(of score:) >=2);
If there's a possibility that one or more SCOREn variables have missing values, then try:
flag=(min(of score:) >=2 and nmiss(of score:) = 0);
Roger
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Prasad
Sent: Monday, November 15, 2004 1:58 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS Help
I have the following data
DATA A;
INPUT ID SCORE1-SCORE3;
CARDS;
11 2 6 28
12 1 3 6
13 0 4 1
14 2 3 78
15 7 24 5
I want to create a Flag 1 or 0, if SCORE1, SCORE2 and SCORE3 is atleast 2.
So my output should look like this
ID SCORE1 SCORE2 SCORE3 FLAG
11 2 6 28 1
12 1 3 6 0
13 0 4 1 0
14 2 3 78 1
15 7 24 5 1
I want to use do loops since I may have SCORE1-SCORE6 OR SCORE1-SCORE9
I would appreciate if anybody can help me in this.