BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ernie86
Calcite | Level 5

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);

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This line

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

contains

&datasets_JUL_2016

which is being treated as a single macro variable. It should be
&datasets._JUL_2016

to indicate the the literal text _JUL_2016 is appended to the value of &datasets. Note the added period.

View solution in original post

2 REPLIES 2
Reeza
Super User

Can you post the log after turning on MPRINT and SYMBOLGEN. 

 

options MPRINT SYMBOLGEN;

ballardw
Super User

This line

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

contains

&datasets_JUL_2016

which is being treated as a single macro variable. It should be
&datasets._JUL_2016

to indicate the the literal text _JUL_2016 is appended to the value of &datasets. Note the added period.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1073 views
  • 2 likes
  • 3 in conversation