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,

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 472 views
  • 0 likes
  • 2 in conversation