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:
SUBID | TESTCD | DATE | TPT |
101 | DOSE1T | 19-Feb-22 | |
101 | NAUP | ||
101 | PHTP | SBDOSE | |
101 | DOSE1T | 25-Feb-22 | |
101 | NAUP | ||
101 | PHTP | DBDOSE | |
102 | DOSE1T | 26-Feb-22 | |
102 | NAUP | ||
102 | PHTP | SBDOSE |
Expecting output:
SUBID | TESTCD | DATE | TPT | SB_DATE | DB_DATE |
101 | DOSE1T | 19-Feb-22 | 19-Feb-22 | ||
101 | NAUP | 19-Feb-22 | |||
101 | PHTP | SBDOSE | 19-Feb-22 | ||
101 | DOSE1T | 25-Feb-22 | 25-Feb-22 | ||
101 | NAUP | 25-Feb-22 | |||
101 | PHTP | DBDOSE | 25-Feb-22 | ||
102 | DOSE1T | 26-Feb-22 | 26-Feb-22 | ||
102 | NAUP | 26-Feb-22 | |||
102 | PHTP | SBDOSE | 26-Feb-22 |
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.
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!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: