vendredi 3 novembre 2017

Using Toggle Statements in SAS

I am attempting to create a program that toggles certain sections of the code on or off based on user input. The code below should only run when the prog1 variable is set equal to Y. However, my log is showing that the code runs no matter what. Does anyone know what is going on?

Code:

%let prog1 = Y;
%let prog2 = N;

data _null_;
if "&prog1." = "Y" then do;
    %findit(&file1.);
    %findit(&file2);
end;
run;

data _null_;
if "prog2." = "Y" then do;
    %findit(&file3.);
end;
run;

Log:

Log file showing that the macro runs even when the prog variable is set to N

Aucun commentaire:

Enregistrer un commentaire