f



Re: Help on data creation for SAS #6

Jack and Ya have pointed out your problem. In addition, I see some
redundancy within

If first.id then do ..... block.

After writing the record out you are resetting the values identical to the
conditions within the ELSE DO block.

If a second record is required to be written for the first.id then you need
another OUTPUT statement before the end. It is hard to guess what is needed
without further details. You have made a good effort by giving us a sample.
Can you also provide a sample output for the corresponding sample input? In
other words provide:

1. What you have (the input)
2. What you want out of it (the output)

Somebody will proide a response in due course.

Venky Chakravarthy


On Tue, 28 Nov 2006 15:23:29 -0500, Jack Clark <JClark@CHPDM.UMBC.EDU>
wrote:

>Kumar,
>
>The use of only 1 OUTPUT statement is at least part of the problem.  When
>you explicitly code an OUTPUT statement in the DATA step, you have to
>explicitly code it in each place you want to output.
>
>In the code that you sent, the OUTPUT statement only processes when
>FIRST.ID.  Try adding another OUTPUT statement at the end of the ELSE DO
>block.
>
>DATA A;
>SET B;
>BY ID;
>IF FIRST.ID THEN DO;
>        EVID = 1;
>        MDV = 1;
>        DV= 0;
>        CMT = 1;
>        AMT = DOSE;
>        OUTPUT;
>        AMT= .;
>        EVID = 0;
>        DV = CONC;
>        CMT = 2;
>END;
>ELSE DO;
>       AMT = .;
>       EVID = 0;
>       DV = CONC;
>       CMT = 2;
>       OUTPUT;
>END;
>RUN;
>
>
>Jack Clark
>Research Analyst
>Center for Health Program Development and Management
>University of Maryland, Baltimore County
>
>
>
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Kumar
>Sent: Tuesday, November 28, 2006 3:01 PM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Help on data creation for SAS
>
>Dear Sir,
>
>I have data set that i am preparing for use in NONMEM. I used an
>existing macro in SAS to create the data file, but i am able to read
>only the first row which is the data at time zero (a sample of the data
>set shown below) none of the other observations are recorded onto my
>output file... Can you please help me
>
>DATA A;
>
>SET B;
>
>BY ID;
>
>IF FIRST.ID THEN DO;
>
>        EVID = 1;
>        MDV = 1;
>        DV= 0;
>        CMT = 1;
>        AMT = DOSE;
>        OUTPUT;
>        AMT= .;
>       EVID = 0;
>        DV = CONC;
>        CMT = 2;
>       END;
>       ELSE DO;
>       AMT = .;
>       EVID = 0;
>       DV = CONC;
>       CMT = 2;
>       END;
>      RUN;
>
>Sample Data Set
>
>
>
>  ID    TIME    CONC    DOSE
>101     0       0       5000
>101     0.25    0       5000
>101     0.5     1.8     5000
>101     0.75    16.5    5000
>101     1       20.9    5000
>101     1.5     32.3    5000
>101     2       28.2    5000
>101     3       24.7    5000
>101     4       24.4    5000
>102           0               0            5000
>102             0.25        20           5000
>
>
>Regards
>Kumar
0
swovcc (579)
11/28/2006 8:38:18 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

0 Replies
371 Views

Similar Articles

[PageSpeed] 38

Reply: