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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1754 views
  • 3 likes
  • 4 in conversation