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

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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