DATA Step, Macro, Functions and more

Can't get INTNX to work inside %SYSFUNC

Accepted Solution Solved
Reply
Trusted Advisor
Posts: 1,933
Accepted Solution

Can't get INTNX to work inside %SYSFUNC

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?


Accepted Solutions
Solution
‎09-07-2012 01:21 PM
Super User
Super User
Posts: 7,078

Re: Can't get INTNX to work inside %SYSFUNC

Posted in reply to PaigeMiller

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


All Replies
Solution
‎09-07-2012 01:21 PM
Super User
Super User
Posts: 7,078

Re: Can't get INTNX to work inside %SYSFUNC

Posted in reply to PaigeMiller

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.);

Trusted Advisor
Posts: 1,933

Re: Can't get INTNX to work inside %SYSFUNC

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

🔒 This topic is solved and locked.

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

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