BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
PaigeMiller
Diamond | Level 26

Here's my existing code, that always gives me an error

%let abc=%sysfunc(intnx('dtday',1662637746,365),datetime16.);

%put ABC &abc;

the large value 1662637746 is simply today's date and time in numeric format, which should work. I have tried other formats, including '07SEP12:00:00:00'dt, but I always get the same error message:

WARNING: An argument to the function INTNX referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range.

NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been

      set to a missing value.

So what am I doing wrong?

--
Paige Miller
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Quotes around text literals are invalid when using %SYSFUNC().  In general quotes are not needed in the macro environment.  They are needed in SAS so the compiler can tell what is a variable reference and what is a text literal. But everything is just text strings to the macro language.

%let abc=%sysfunc(intnx(dtday,1662637746,365),datetime16.);

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

Quotes around text literals are invalid when using %SYSFUNC().  In general quotes are not needed in the macro environment.  They are needed in SAS so the compiler can tell what is a variable reference and what is a text literal. But everything is just text strings to the macro language.

%let abc=%sysfunc(intnx(dtday,1662637746,365),datetime16.);

PaigeMiller
Diamond | Level 26

Thanks, Tom, I knew it must be something simple.

--
Paige Miller

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 6056 views
  • 4 likes
  • 2 in conversation