BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sra2786
Calcite | Level 5

I want to create a table that has all the HH:MM possible for the day (ie, 00:00, 00:01, 00:02, .... 23:58, 23:59).  I do not know how to do this.  I have searched for a solution but I cannot find one.

 

DATA TIMES;

HHMM = '00:00't;

DO i=0 to 1439

   HHMM = HHMM + 1 minute    < I don't know how to do this

   output;

END;

 

Can someone tell me how to do this/

Thanks.

Sandy

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Time is in seconds, so a minute is 60 seconds. Try adding 60 instead of 1.

You could also do it as:

Try a loop like this (untested)

do time="00:00"t to "23:59"t by 60;
output;
end

View solution in original post

2 REPLIES 2
Reeza
Super User
Time is in seconds, so a minute is 60 seconds. Try adding 60 instead of 1.

You could also do it as:

Try a loop like this (untested)

do time="00:00"t to "23:59"t by 60;
output;
end
sra2786
Calcite | Level 5

Thanks.  That worked.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 2 replies
  • 1174 views
  • 0 likes
  • 2 in conversation