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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Autotuning Deep Learning Models Using SAS

Follow along as SAS’ Robert Blanchard explains three aspects of autotuning in a deep learning context: globalized search, localized search and an in parallel method using SAS.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2413 views
  • 3 likes
  • 3 in conversation