Hello, can anyone see in the code below why I might be getting the "ERROR 180-322: Statement is not valid or it is used out of proper order"? libname x"\\...; %macro copy_two(qtrname, year, filename); libname A"\\...; libname B"\\...; data B.&filename.&qtrname.&year. (keep=ID cost);/*any other variables to keep go here*/ /*qtr=&qtrname.; year=&year.;*/ set A.&filename.; run; proc sql; create table B..x&filename.&qtrname.&year. as select * from B.&filename.&qtrname.&year.; quit; %mend copy_two; %macro loop(start,end); %do i = &start. %to &end.; %copy_two(Mar, &i., file); %copy_two(Jun, &i., file); %copy_two(Sep, &i., file); %copy_two(Dec, &i., file); %end; %mend loop; /*specify the years of interest*/ %loop(11,21)
... View more