I am using
%SYSFUNC(cats(&number,_,'>',%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)))
in a Macro to create the text
14_>31.12.2018
However, I get the error:
-----------------------------
NOTE: Line generated by the macro function "SYSFUNC".
23 14_'>'31.12.2018
___
49
----------------------------
How can I eliminate the error?
Agree with chang_y_chung: just try without CATS.
Your code:
%SYSFUNC(cats(&number,_,'>',%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)))
Edited code:
&number_>%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)
Try %str(>) instead of single quotes in a macro.
%SYSFUNC(cats(&number,_,%str(>),%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)));
Hope this helps a bit. Good luck!
%*-- cats() called through %sysfunc() seems to evaluate > as a logical expression
even when macro quoted. ran on 9.3 ts1m0 on w32_7pro --*;
%put %sysfunc(cats(***,%str(>),***));
%*-- on log -- 0 since null(nothing) is not greater than another null.
***0***
--*;
%*-- but we do not need cats for string concatenation in macro --*;
%let number = 14;
%let date = %sysfunc(today());
%let ldopy = %sysfunc(intnx(year, &date, -1, end), DDMMYYP10.);
%put last day of previous year = &ldopy;
%put &number._>&ldopy;
%*-- on log
14_>31.12.2011
--*;
Agree with chang_y_chung: just try without CATS.
Your code:
%SYSFUNC(cats(&number,_,'>',%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)))
Edited code:
&number_>%SYSFUNC(Intnx(year, &dvar, -1, end), DDMMYYP10.)
Ok thx, it works!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.