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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 4079 views
  • 3 likes
  • 4 in conversation