The SAS Output Delivery System and reporting techniques

how to make proc report read from multiple data sets?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

how to make proc report read from multiple data sets?

Im trying to run couple reports that reading from different datasets. For some reason, it keeps giving me this "WARNING: Apparent symbolic reference DATASETS_JUL_2016 not resolved.", and the macro is not working. Can someone please tell me what is wrong with my code below.

 

 

 

%macro report(datasets);


ODS Tagsets.ExcelXP FILE= "J:\mydrive\&datasets_JUL_2016.xls"  style=fancyprinter;

proc report data=&datasets nofs split='*';

          column School ID Class student;

          define School / display style={just=left foreground=black cellwidth=70};

          define ID / display style={just=left foreground=black cellwidth=70};

          define Class / display style={just=left foreground=black cellwidth=70};

          define Student / display style={just=left foreground=black cellwidth=70};

run;

ODS Tagsets.ExcelXP close;
%mend report;

%report(abc);

%report(efg);

 


Accepted Solutions
Solution
‎07-22-2016 03:52 PM
Super Contributor
Posts: 394

Re: how to make proc report read from multiple data sets?

SAS thinks your macro variable is &datasets_JUL_2016. Put a period between datasets and _JUL, like this:

 

&datasets._JUL_2016

 

View solution in original post


All Replies
Solution
‎07-22-2016 03:52 PM
Super Contributor
Posts: 394

Re: how to make proc report read from multiple data sets?

SAS thinks your macro variable is &datasets_JUL_2016. Put a period between datasets and _JUL, like this:

 

&datasets._JUL_2016

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 397 views
  • 0 likes
  • 2 in conversation