Date: Tue, 28 Dec 1999 15:10:39 +0000
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland <roland.rashleigh-berry@VIRGIN.NET>
Subject: Re: A data step question
Content-Type: text/plain; charset=us-ascii
set man(in=_m) woman(in=_w);
if _m then gender='M';
else if _w then gender='F';
> Hi Friends,
> Suppose I have two datasets: MAN (observations of man), WOMAN (obs of
> 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;
> DATA WOMAN;
> SET WOMAN;
> Can you teach a clever syntax to do this ?
> Thanks in advance.