BookmarkSubscribeRSS Feed
Astounding
PROC Star

I can give you a little guidance, but I can't solve it.  I'm having trouble seeing how the output you post matches your description of what you want to achieve.  Regardless of what is needed, however, this looks like a case where the problem would become easier if you were to transpose the data.  Picture one observation per ID, with variables StartDate1 through StartDate20 and Drug1 through Drug20.  (Of course, 20 is an arbitrary number ... you need to create enough variables to hold the data for the patient with the largest number of dates.)

 

While I rarely recommend transposing data into that form, this strikes me as a problem that would become easier if you were to do that.

 

Good luck.

shasank
Quartz | Level 8
@Reeza Can you help me with this question?
shasank
Quartz | Level 8
@Tom Can you help me with this question.??

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 17 replies
  • 2607 views
  • 3 likes
  • 4 in conversation