02-15-2016 04:25 PM
%Macro Final (investor,sheet_nm);
PROC REPORT DATA=&final. headskip split='*' wrap nowd (WHERE = (investor_class = "&investor."))
style(report)=[background=black cellspacing=10 just=center font_size=11pt font_face="Calibri" bordercolor=black borderwidth=1]
style(column)=[background=white font_size=10pt bordercolor=black borderwidth=1]
I want to create a 3 tab report based on the investor_class. When I run this I get an error saying there is an expected quote or string error. Any ideas on what is wrong with the code
WARNING: Apparent symbolic reference FINAL not resolved.
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (, CONNECTION, DICTIONARY.
ERROR 200-322: The symbol is not recognized and will be ignored.
02-15-2016 05:21 PM
You have referenced a macro variable FINAL, but apparently this macro variable has not been defined previously. There is
So, what are the values which you want to pass as the first parameter to macro NoAccountLogic and use as input dataset name for PROC REPORT? (Maybe FNMA, FHLMC, etc.?)
This is what the SAS compiler is wondering when you execute macro FINAL (which is totally unrelated to a macro variable of the same name), hence the initial WARNING message. (I hope there is a %MEND statement in your real code.)
02-16-2016 04:28 AM
Why are you writing macros, and such like to output data to multiple sheets? There is by group functionality in most of SAS including tagsets output, have a look at the documentation:
By default, a new worksheet is generated for each table. You can override this and create a new worksheet for each procedure, bygroup, or never. The example here creates a new worksheet for each bygroup.
ods tagsets.excelxp file='multisheet.xls' style=statistical options( sheet_interval='bygroup' ); proc sort data=sashelp.class out=class; by age; run; proc print data=class; by age; run; ods tagsets.excelxp close;