Date: Wed, 25 Apr 2007 14:52:11 -0500
Reply-To: Jane <program.sas@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jane <program.sas@GMAIL.COM>
Subject: Re: Data step question
In-Reply-To: <7367b4e20704251243p7a7a17f6t1dbc6547a2472b9@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Thanks, the problem was solved. :-)
On 4/25/07, data _null_; <datanull@gmail.com> wrote:
>
> Consider the expression used to compute FLAG. How you use is your choice.
>
> data;
> infile cards missover;
> input pid (var1-var5)(:$3.);
> flag = not missing(coalesceC(of var:));
> cards;
> 111 aaa bbb
> 222 . ccc . ddd
> 333
> 444 aaa
> 555 . . eee
> 666
> ;;;;
> run;
> proc print;
> run;
>
> On 4/25/07, Jane <program.sas@gmail.com> wrote:
> > Hi, All
> >
> > I have a dataset with the structure like this:
> >
> > pid var1 var2 var3 var4 var5
> > ---------------------------------------
> > 111 aaa bbb
> > 222 ccc ddd
> > 333
> > 444 aaa
> > 555 eee
> > 666
> >
> > I want to pick up the subjects with any of var1-var5 have value. Like
> this
> >
> > pid
> > ----
> > 111
> > 222
> > 444
> > 555
> >
> > How can I do this in some simple way, since I actually have 20 var. If I
> use
> > if... then... that is really a lot work to do.
> > Thanks
> >
> > Jane
> >
>
|