BookmarkSubscribeRSS Feed
hhchenfx
Barite | Level 11

Hi,

I want to put hour and minute of the time 20 second before current time into macro variable.

The code below might convey my idea better.

Can you please help?

Thanks,

HHC

 

%let now=%sysfunc(time()       MINUS 20 SECOND);
%let hh=%sysfunc(hour(&now),z2.);
%let mm=%sysfunc(minute(&now),z2.);

%put &hh &mm;
0 Likes
1 REPLY 1
Astounding
Opal | Level 21
Have you tried

%let now = %sysfunc(time() ) - 20;

The other statements probably figure out to perform the math without even adding %eval
0 Likes
JUST RELEASED

SAS Viya with pay-as-you-go pricing.

Deploy software automatically at the click of a button on the Microsoft Azure Marketplace.

Learn more

55 percent discount.jpg

Recommended by SAS
These recommendations are generated using AI from SAS. For personalized recommendations, sign in with your SAS profile.
Discussion stats
  • 1 reply
  • 60 views
  • 0 likes
  • 2 in conversation