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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.