DATA Step, Macro, Functions and more

I need a code for the following scenerio

Reply
N/A
Posts: 0

I need a code for the following scenerio

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)
Respected Advisor
Posts: 4,173

Re: I need a code for the following scenerio

Posted in reply to deleted_user
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.
Ask a Question
Discussion stats
  • 1 reply
  • 101 views
  • 0 likes
  • 2 in conversation