SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
zimcom
Pyrite | Level 9

 

Hi Community,

 

I have a dataset where I need only to change the red vs2 date to a day later  (in below the first vs2 date really should be 24APR2015:00:06:00) and the last vs2 date really should be 22NOV2017:00:04:00, while the other dates should remain the same.

How should I handle situation like this?  Thanks as always 

 

vs1vs2
23APR2015:23:51:0023APR2015:00:06:00
05MAY2015:13:00:0005MAY2015:12:59:00
06JUN2015:18:52:0006JUN2015:18:52:00
23AUG2015:23:32:0023AUG2015:23:30:00
10SEP2015:20:39:0010SEP2015:20:32:00
23SEP2015:21:48:0023SEP2015:21:44:00
07DEC2015:12:45:0007DEC2015:12:27:00
21NOV2017:23:40:0021NOV2017:00:04:00
1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
Tom
Super User Tom
Super User

Is there logic for why those two need to change? Or do you just want to test for any value on those dates?

zimcom
Pyrite | Level 9

@Tom

 

Thank you for inquiring, those values in red are the correct values, basically vs2 should start a few minutes after vs1, so the situation is vs1 and vs2 just happens to cross the midnight, while the other values have issues which I don't want to program to change, they need further investigation

zimcom
Pyrite | Level 9

@Kurt_Bremser

Thanks for inquiring. I plan to use 

vs1_2 = INTCK('hour',vs2,vs1);

vs1_2  = 23;

to indentify those values across the midnight.

 

zimcom
Pyrite | Level 9

@Kurt_Bremser

I should add 24 hours to vs2 to bring vs2 one day ahead of its current status, that is my plan, just like to consult the experts here   

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 6 replies
  • 6334 views
  • 0 likes
  • 3 in conversation