我遇到了这个看起来很简单的问题。
我有这样的宏:
slim
所以基本上相反,%macro test;
/* I start from it */
%let time_ = %sysfunc(time());
%let date_ = %sysfunc(date());
%let time1 = %sysfunc(time());
data _null_;
timedelay = sleep(5, 1);
run;
%let time2 = %sysfunc(time());
%let diff = %sysevalf(&time2 - &time1);
%put Timenow: &time_;
%put DateNOw: &date_;
%put TimeDifference: &diff;
/*Above works as I want*/
/* What I want to have */
%put Timenow: %sysfunc(put(&time_, time13.)); /* Timenow: 22:06:00 */
%put DateNOw: %sysfunc(put(&time_, date9.)); /* DateNOw: 27FEB2019 */
%put TimeDifference: %sysfunc(put(&time_, time13.)); /* TimeDifference: 00:00:05 */
%mend;
%test;
会给我带来类似的结果:%sysfunc(put(&time_, time13.));
有没有简单而直接的方法可以做到这一点?
谢谢!
答案 0 :(得分:0)