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 (June 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Jun 2004 14:53:04 +0200
Reply-To:     "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Groeneveld, Jim" <jim.groeneveld@VITATRON.COM>
Subject:      Re: Help with the data
Comments: To: Prasad <prasad_prabhud@HOTMAIL.COM>
Content-Type: text/plain; charset="iso-8859-1"

Hi Prasad,

The code below has been tested and works correctly:

DATA Months; INPUT Patient Jan Feb Mar Apr May; CARDS; 123 2 4 6 0 3 125 0 2 3 6 0 129 1 0 2 3 3 120 0 0 1 6 2 128 0 0 0 3 9 ; RUN;

DATA Months (DROP=Jan -- May Month MonthNr); SET Months; ARRAY MonthN (5) $ MonthN1 - MonthN5; MonthNr = 0; Tot_Mnths = 0; * explicit inits for each observation; DO Month = Jan, Feb, Mar, Apr, May; IF (Month > 0) THEN DO; MonthNr + 1; * sum statement; MonthN[MonthNr] = 'Y'; Tot_Mnths + 1; END; ELSE IF (MonthNr > 0) THEN DO; MonthNr + 1; * sum statement; MonthN[MonthNr] = 'N'; Tot_Mnths + 1; END; END; RUN;

PROC PRINT DATA=Months; RUN;

Regards - Jim. -- . . . . . . . . . . . . . . . .

Jim Groeneveld, MSc. Biostatistician Science Team Vitatron B.V. Meander 1051 6825 MJ Arnhem Tel: +31/0 26 376 7365 Fax: +31/0 26 376 7305 Jim.Groeneveld@Vitatron.com www.vitatron.com

My computer may have missed me, I did not; it, that is.

[common disclaimer]

-----Original Message----- From: Prasad [mailto:prasad_prabhud@HOTMAIL.COM] Sent: Tuesday, June 01, 2004 20:19 To: SAS-L@LISTSERV.UGA.EDU Subject: Help with the data

I have the following sample data: Patient Jan Feb Mar Apr May 123 2 4 6 0 3 125 0 2 3 6 0 129 1 0 2 3 3 120 0 0 1 6 2 128 0 0 0 3 9

I want the following output which shows 1 thru 5 months with flag Y or N depending on whether Patient gets the dose starting from the (patients) 1st month.

Patient 1 2 3 4 5 TOT_MNTHS 123 Y Y Y N Y 5 125 Y Y Y N 4 129 Y N Y Y Y 5 120 Y Y Y 3 128 Y Y 2

I would appreciate any help in this. Thanks


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