BookmarkSubscribeRSS Feed
Spintu
Quartz | Level 8

Having data is my actual data. I am trying to create as per SUBID, if TESTCD = ' DOSE1T' and TPT value is "SBDOSE" then date value should be SB_DATE. Similarly, for DBDOSE.

I am having issues with if I select TESTCD = ' DOSE1T' then TPT value is blank. 

Having data:

SUBIDTESTCDDATETPT
101DOSE1T19-Feb-22 
101NAUP  
101PHTP SBDOSE
101DOSE1T25-Feb-22 
101NAUP  
101PHTP DBDOSE
102DOSE1T26-Feb-22 
102NAUP  
102PHTP SBDOSE

 

Expecting output:

SUBIDTESTCDDATETPTSB_DATEDB_DATE
101DOSE1T19-Feb-22 19-Feb-22 
101NAUP  19-Feb-22 
101PHTP SBDOSE19-Feb-22 
101DOSE1T25-Feb-22  25-Feb-22
101NAUP   25-Feb-22
101PHTP DBDOSE 25-Feb-22
102DOSE1T26-Feb-22 26-Feb-22 
102NAUP  26-Feb-22 
102PHTP SBDOSE26-Feb-22 
1 REPLY 1
PaigeMiller
Diamond | Level 26

Show us the full code you are using, and if there are errors in the LOG, then show us the full LOG as well. Please provide data as working SAS data step code (instructions) and not in any other format.

--
Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 240 views
  • 0 likes
  • 2 in conversation