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: 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 25. 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
  • 1 reply
  • 674 views
  • 0 likes
  • 2 in conversation