Help using Base SAS procedures

SAS processing time calculation problem

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 117
Accepted Solution

SAS processing time calculation problem

hey guys,

so I use this code to calculate the total processing time the sas program took to run but it is reporting a negative value (espicially when the program runs for more than 1 day):

%let datetime_start = %sysfunc(TIME()) ;

%put START TIME: %sysfunc(datetime(),datetime14.);

then at the end of the program I put this:

%put END TIME: %sysfunc(datetime(),datetime14.);

%put PROCESSING TIME:  %sysfunc(putn(%sysevalf(%sysfunc(TIME())-&datetime_start.),mmss.)) (mm:ss) ;

not sure what to fix?


Accepted Solutions
Solution
‎03-28-2012 09:11 AM
Respected Advisor
Posts: 3,124

SAS processing time calculation problem

You need to use datetime value if the program running time is more than 1 day. Make them both datatime.

%let datetime_start = %sysfunc(dateTIME()) ;

%put PROCESSING TIME:  %sysfunc(putn(%sysevalf(%sysfunc(dateTIME())-&datetime_start.),mmss.)) (mm:ss) ;

Regards,

Haikuo

View solution in original post


All Replies
Solution
‎03-28-2012 09:11 AM
Respected Advisor
Posts: 3,124

SAS processing time calculation problem

You need to use datetime value if the program running time is more than 1 day. Make them both datatime.

%let datetime_start = %sysfunc(dateTIME()) ;

%put PROCESSING TIME:  %sysfunc(putn(%sysevalf(%sysfunc(dateTIME())-&datetime_start.),mmss.)) (mm:ss) ;

Regards,

Haikuo

Frequent Contributor
Posts: 117

SAS processing time calculation problem

thansk!!

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 1169 views
  • 0 likes
  • 2 in conversation