Date: Thu, 31 Aug 2006 18:11:52 +0000
Reply-To: toby dunn <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: toby dunn <tobydunn@HOTMAIL.COM>
Subject: Re: help using formats
In-Reply-To: <1157047399.441285.98870@b28g2000cwb.googlegroups.com>
Content-Type: text/plain; format=flowed
Meg ,
Yes there is:
roc Format ;
Value Sex
1 = 'Male'
2 = 'Female'
;
Run ;
Data Have ;
Format Sex Sex. ;
Sex = 1 ;
Output ;
Sex = 2 ;
Output ;
Run ;
Data Need ;
Set Have ;
If VValue( Sex ) = 'Male' Then Do ;
Text = 'Its A Boy ' ;
End ;
Else Do ;
Text = 'Its A Girl' ;
End ;
Run ;
Proc Print
Data = Need ;
Run ;
Toby Dunn
When everything is coming at you all at once, your in the wrong lane.
A truly happy person is someone who can smile and enjoy the scenery on a
detour.
From: Meg <napu1975@HOTMAIL.COM>
Reply-To: Meg <napu1975@HOTMAIL.COM>
To: SAS-L@LISTSERV.UGA.EDU
Subject: help using formats
Date: Thu, 31 Aug 2006 11:03:19 -0700
Hello..
Is there a way for me to ID numeric variables by its format in a data
set?
example 1=male 2=female
is there a way I could do something like this
If gender ='Male' then ...
else if gender= "female"
Is there special syntax that would allow that kind of programming with
numeric vars?
thanks!