Date: Wed, 11 Mar 2009 21:13:05 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Data Step
Zintie,
Is the following what you are trying to do?:
data have;
infile cards missover;
input pt @5 indic $1. @8 cmverb $1. @10 cmpref $1.;
cards;
101 Y X
101 z
101 X z
102 N
;
data want;
set have;
by pt;
format hold_indic $1.;
retain hold_indic;
if first.pt then call missing(hold_indic);
if not(missing(indic)) then hold_indic=indic;
if hold_indic eq 'Y' and not(missing(cmverb))
and not(missing(cmpref)) then output;
run;
Art
---------
On Wed, 11 Mar 2009 10:00:25 -0700, Zintie <raisins25@YAHOO.COM> wrote:
>Hi all,
>
>
>pt indic cmverb cmpref
>---------------------------------------
>
>101 Y X
>
>101 z
>
>101 X z
>
>102 N
>
>I want a way to let the user know that the patient 101 is good to go
>because his Indicator is Y and atleast in one record he has a non
>missing VT AND PT (record 3)
>
>I want to know whether there is a way i can flag this patient a Yes by
>iterating thru the pt list..
>
>Thanks!!