BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Hello Everyone,

 

can someone explain why this works fine:

 

data worksfine;

starttime = time(); 
duration = 5;
stoptime = intnx('minute', starttime, duration, 'S');
stoptime2 = intnx('minute', time(), duration, 'S');

put _ALL_;

format starttime   stoptime: time8.;
run;

But this does not work:

/*Stop Time*/
%LET s_time = %sysfunc(intnx('minute',  %sysfunc(time()), 5, 'S'));
%PUT &s_time.;

Cheers,

FK

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

Since the macro preprocessor is a pure text processor, quotes are not needed for string values:

%LET s_time = %sysfunc(intnx(minute,%sysfunc(time()),5,S),time8.);
%PUT &s_time.;

View solution in original post

2 REPLIES 2
Kurt_Bremser
Super User

Since the macro preprocessor is a pure text processor, quotes are not needed for string values:

%LET s_time = %sysfunc(intnx(minute,%sysfunc(time()),5,S),time8.);
%PUT &s_time.;
FK1
Lapis Lazuli | Level 10 FK1
Lapis Lazuli | Level 10

Thank's Kurt for helping me out!

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
  • 789 views
  • 0 likes
  • 2 in conversation