LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (December 1999, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Dec 1999 16:19:16 +0100
Reply-To:     Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:      Re: A data step question
Comments: To: cpwong <cpwong@SE.CUHK.EDU.HK>
Content-Type: text/plain; charset="iso-8859-1"

cp,

DATA Human; SET MAN (IN=Male) Woman; IF Male THEN Gender='M'; ELSE Gender='F'; RUN; *===UNTESTED===;

Regards - Jim. -- Y. Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statistician, P.O. Box 1 fax. +31 412 407 080 head IT department 5350 AA BERGHEM IMRO TRAMARKO: a CRO J.Groeneveld@ITGroups.com the Netherlands in clinical research

I wish you a merry Christmas and a happy, compatible y²°°°

"My job is to keep my computer working." - Jim Groeneveld

> -----Original Message----- > From: cpwong [SMTP:cpwong@SE.CUHK.EDU.HK] > Sent: Tuesday, December 28, 1999 3:45 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: A data step question > > Hi Friends, > > Suppose I have two datasets: MAN (observations of man), WOMAN (obs of > woman) > Both datasets have 2 variables: NAME, AGE > > Now I would like to have a single dataset HUMAN > > DATA HUMAN; > SET MAN WOMAN; > > But I want to have an additional variable GENDER. So that All MAN obs > should have GENDER=M. All WOMAN obs should have =F. > > I know a stupid way is > > DATA MAN; > SET MAN; > GENDER='M'; > > DATA WOMAN; > SET WOMAN; > GENDER='F'; > > > Can you teach a clever syntax to do this ? > > Thanks in advance. > cp


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