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

%macro add_new_year_in_cal;
%global Path;

%let Path=/dwh_operation/sasprocess/smp_production/prod_smpi2/sasmacro/;

OPTIONS SASAUTOS=("&Path.");

%localizepilottbl;

%include "&Path.update_trigger.sas";
%put &UpdatePilotTblTrigger.;

%if &UpdatePilotTblTrigger. = 'Y' %then
%do;
%include"&Path.copyfilefromreftosmpi2.sas";
%end;

%mend add_new_year_in_cal;
options mprint;
%add_new_year_in_cal;

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
Always keep in mind that the macro processor is a text engine and does not need quotes for strings, as everything is a string.
You are testing for 'Y'. If your macro variable does not contain the quotes, the comparison will fail.

View solution in original post

3 REPLIES 3
alepage
Barite | Level 11
the function copyfilefromreftosmpi2.sas is not executed even if the updatepilottbltrigger=Y
Reeza
Super User

Can you please format your code for legibility and use a code box? It really helps for reading code. 

Have you tried removing the quotes in the comparison? I'm fairly certain that's required in macro coding.

 

%macro add_new_year_in_cal;
%global Path;

%let Path=/dwh_operation/sasprocess/smp_production/prod_smpi2/sasmacro/;

OPTIONS SASAUTOS=("&Path.");

%localizepilottbl;

%include "&Path.update_trigger.sas";
%put &UpdatePilotTblTrigger.;

%if &UpdatePilotTblTrigger. = Y %then
%do;
%include"&Path.copyfilefromreftosmpi2.sas";
%end;

%mend add_new_year_in_cal;
options mprint; %add_new_year_in_cal;

If that doesn't work, please post your log from your code after adding the MLOGIC option to your OPTIONS statement.

 


@alepage wrote:
the function copyfilefromreftosmpi2.sas is not executed even if the updatepilottbltrigger=Y

 

Kurt_Bremser
Super User
Always keep in mind that the macro processor is a text engine and does not need quotes for strings, as everything is a string.
You are testing for 'Y'. If your macro variable does not contain the quotes, the comparison will fail.