1
votes

I tried to run conditional sas script based on the macro variable &syshostname.

data name;
    name = "&syshostname.";
run;

data _null_;
    set name;
    if name = 'abc' then 
        do;
            call symput('rrun','script1.sas');
        end;
    else 
        do;
            call symput('rrun','script2.sas');  
        end;
run;
%include &rrun.;

Error Message: WARNING: Physical file does not exist, C:\Program Files\SASHome\SASFoundation\9.3\&rrun..

How can i direct it use the path &runn.. but not with those C:\Program Files XXXX ?

1

1 Answers

0
votes

If you dont provide a path for your files, a specific default path will be choosen.

So where are your files script1.sas and script2.sas located?

You must add the path to the location of the files in the macrovariable, e.G.:

call symput('rrun','D:\mySasFiles\scripts\script1.sas');

also, when including the files, you must provide the path as string, so you need to add ""

 %include "&rrun";

Another option would be to save your script files in the default path location, but anyway, you need to add the "".