Help using Base SAS procedures

Trying to get first.dosedate with some doses missing

Reply
Occasional Contributor
Posts: 7

Trying to get first.dosedate with some doses missing

data lab;

set lab1;

by usubjid dose dosedate;

if first.dosedate then d=1;

else d + 1;

run;

I was trying to get the first dosedate as i have some dose missing.

Can someone suggest better options.

Thank you

Super User
Posts: 11,343

Re: Trying to get first.dosedate with some doses missing

I think you want first.dose as you want the first occurence of dosedate within a dose, correct? But WHICH dose dates are missing? If you sorted your data by usubjid dose and dosedate then the first dosedate(s) would be the missing ones.

I might look at

Proc summary data=lab1 nway;

     class usubjid dose;

     where dosedate ne .;
     var dosedate;

     output lab min(dosedate) = firstdosedate;

run;

Ask a Question
Discussion stats
  • 1 reply
  • 154 views
  • 0 likes
  • 2 in conversation