SASPYTHON
SASPYTHON

Reputation: 1621

SAS MACRO how to assign MACRO to date9

I try to reassign macro to new macro, which I want to create date9.

so my code is this

    %Let CALYEAR   =2020;
    %let AYEAR     =%SYSEVALF(&CALYEAR-1);

    FALLSTART_ONE=%sysfunc(15AUG&AYEAR,date9.);

so I assume Macro variable "AYEAR" is 2019 and I want to create macro variable "FALLSTART_ONE" =15AUG2019

but error is

212  FALLSTART_ONE=%sysfunc(15AUG&AYEAR,date9.);
     -------------
     180
ERROR: Function name missing in %SYSFUNC or %QSYSFUNC macro function reference.

How should I fix it?

Thanks

Upvotes: 0

Views: 146

Answers (1)

Stu Sztukowski
Stu Sztukowski

Reputation: 12849

You need a %let. You also do not need to enclose it in %sysfunc(). You can build the string as-is.

%let FALLSTART_ONE=05AUG&AYEAR;

Upvotes: 4

Related Questions