BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I need a code for the following scenerio
In a dataset I have columns like Acc_sk,Acc_ID, Coll_Status,Valid_from and Valid_to

Dataset:Account
Acc_sk Acc_ID Coll_Status Valid_from Valid_to
1 001 open 4-13-2009 12:00:09 PM 4-13-2009 23:00:09 PM
2 001 closed 4-13-2009 12:00:10 PM 1-1-2010 23:00:09 PM
3 001 open 1-1-2010 23:00:09PM 1-1-5999 00:00:00
4 002 open 4-13-2009 12:00:09 PM 4-13-2009 23:00:09 PM
5 002 closed 4-13-2009 12:00:10 PM 1-1-5999 00:00:00
I need to apply check in this table that wether the difference between valid_from of each Acc_ID where max(valid_to) and valid_to of its previus row should be of one sec.
Moreover I need to make it generic where the value of target table will be in a macro and also the value of columns(like Acc_ID) will also be stored in a macro as a comma separated list.(means it could be one column or combination of one or more columns)
1 REPLY 1
Patrick
Opal | Level 21
What if:
- you give us a working test dataset (valid input statement).
- you give us an example showing based on the testdata showing how the desired result should look like.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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
  • 1 reply
  • 691 views
  • 0 likes
  • 2 in conversation