Posted 05-04-2022 05:36 PM (2477 views) | In reply to Rick_SAS When a function's name ends with an 'x' it strips leading and trailing blanks. For example, cat('a',' b ') = 'a b ', while catx('a',' b ') = 'ab'. Similarly, call symput("var", " MWSUG ") puts...
Besides CALL SYMPUT, other features of themacro facility that are demonstrated include the construction of macro variable names through concatenation, thedouble ampersand, the %DO loop, the %GOTO statement and statement label, and the implicit %EVAL function.Yunchao...
%LET ReportGeneration=0; DATA _null_; call symput('u_ToPaid_fixed',put(intnx('month',date(),0),yymmn6.)); call symput('u_ToPaid',put(intnx('month',RenewalDate,14-&ReportGeneration), yymmn6.)); RUN; In order to replace %LET ToPaid=201104, I used the SAS DATE () function ...
As is usually the case in SAS, there may be multiple ways to achieve each of these goals, but frequently an efficient, reproducible method will involve interface between the DATA step and the Macro facility. In this paper, I am going to introduce a CALL routine and a SAS function that ...
You may want to add a trim function to varname to remove trailling blanks. SYMPUT puts the macro variable in the most local nonempty symbol table. The first time you run you macro, macro variables are created as local macro variables. %put statement is out of the scope of the macro var...