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 (August 2006, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: To: napu1975@hotmail.com
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!


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