简体   繁体   中英

SAS call one program from a macro inside another program

I have 2 sas programs, I am trying to call program 1 from a macro inside program 2. Program 1 uses a macro variable that I am setting in program 2. But I get: macro variable not resolved error

test1.sas:

data test_&year1.;
a=1;
run;

test2.sas:
%macro x1(&year1);
...other code..;
%include test1.sas
%mend;

%x1(2019);

get rid of the & in %macro statement

%macro x1(year1);

在此处输入图片说明

filename FT15F001 temp;
parmcards4;
data test_&year1.;
   a=1;
   run;
;;;;

%macro x1(year1);
   %put NOTE: &=year1;
   %include FT15F001 / source2;
%mend;

%x1(2019);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM