BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hellohere
Pyrite | Level 9

Running macro with huge loops, and like to print out the end time of each loop in format, such as hhmmss[or with millisecond].

Need this to tell time cost for each loop. 

 

Simply  %put "%sysfunc(time())"; does print out time info, but without format, hard to tell. 

44497    %put "%sysfunc(time())";
"84736.9679999351"
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

So why just add a FORMAT to the %SYSFUNC() call?

%put %sysfunc(time(),time12.3);

Or perhaps better use DATETIME() function so you can track jobs that cross midnight.

%put %sysfunc(datetime(),datetime24.3);

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Assign whatever date/time format you want, like this:

 

 %put %sysfunc(datetime(),datetime19.);
--
Paige Miller
Tom
Super User Tom
Super User

So why just add a FORMAT to the %SYSFUNC() call?

%put %sysfunc(time(),time12.3);

Or perhaps better use DATETIME() function so you can track jobs that cross midnight.

%put %sysfunc(datetime(),datetime24.3);

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