BookmarkSubscribeRSS Feed
TheNovice
Quartz | Level 8

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:

IDTIMEC_DATEe_datenext_dateMEMO_TYPEmemo_datem_dateMEMO_ID
665002-Sep-2002SEP2020:00:00:0003-Oct-20MC03-Oct-2003OCT2020:12:56:024411047528
665103-Oct-2003OCT2020:00:00:0008-Oct-20MC03-Oct-2003OCT2020:12:56:024411047528

Outcome needed:

 

IDTIMEC_DATEe_datenext_dateMEMO_TYPEmemo_datem_dateMEMO_ID
665002-Sep-2002SEP2020:00:00:0003-Oct-20MC03-Oct-2003OCT2020:12:56:024411047528
665103-Oct-2003OCT2020:00:00:0008-Oct-20....

 

Appreciate any and all direction.

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Is the data sorted by memo_ID? Or can the Memo_ID=4411047528 appear further down?

TheNovice
Quartz | Level 8
The data is sorted by ID, C_date and Memo_id. the memo_id would be a unique transaction. It will never appear for another ID
TheNovice
Quartz | Level 8
Hi Draycut,

Would you have a suggestion on this by any chance?

Regards,
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
  • 3 replies
  • 1059 views
  • 0 likes
  • 2 in conversation