Hi there,
hoping for a data step and proc sql solution please.
C_Date and E_date represent same date, different formats. Same for Memo date and m_date
my data has records where the memo_id is duplicated for 2 records because the M_date is equal to the next_date and the c_date.Unfortunately the time stamp in e_date is not specific. So I need the memo_id to only be available for the first/earliest record.
Original:
ID | TIME | C_DATE | e_date | next_date | MEMO_TYPE | memo_date | m_date | MEMO_ID |
665 | 0 | 02-Sep-20 | 02SEP2020:00:00:00 | 03-Oct-20 | MC | 03-Oct-20 | 03OCT2020:12:56:02 | 4411047528 |
665 | 1 | 03-Oct-20 | 03OCT2020:00:00:00 | 08-Oct-20 | MC | 03-Oct-20 | 03OCT2020:12:56:02 | 4411047528 |
Outcome needed:
ID | TIME | C_DATE | e_date | next_date | MEMO_TYPE | memo_date | m_date | MEMO_ID |
665 | 0 | 02-Sep-20 | 02SEP2020:00:00:00 | 03-Oct-20 | MC | 03-Oct-20 | 03OCT2020:12:56:02 | 4411047528 |
665 | 1 | 03-Oct-20 | 03OCT2020:00:00:00 | 08-Oct-20 | . | . | . | . |
Appreciate any and all direction.
Is the data sorted by memo_ID? Or can the Memo_ID=4411047528 appear further down?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.