09-17-2014 08:40 AM
Prior to introducing the macro to this part of the code – each section would create an XML file based on the sheet_name=’ ‘;
Now that I’ve created a macro that reads each data set and performs the function for all eight datasets the naming isn’t working.
Perhaps it’s something simple missing between the ‘ ‘ – ex: ‘&&tb4’ right now it writes each tab for the output data as tb4, tb4 2, tb4 3, …… incrementing by 1 after the tb4.
I’m not sure – New Jack SAS Guy
ODS TAGSETS.EXCELXP file='/windows/Infodata/DRountree/CAB/2014_2015_Competitive_Analysis_HMO_NYC.xml';
*** Define macro3 ***;
ODS TAGSETS.EXCELXP options(sheet_interval='table' suppress_bylines='yes' sheet_name= '&tb4');
PROC REPORT DATA = &tb4 spanrows nowd split='~';
columns CategoryCode CategoryDescription ID_:;
Define CategoryCode / order order=internal noprint;
define CategoryDescription / order 'Plan Name~Current Enrollment~Star Rating~Contract Number/PBP';
define ID_: / display;
compute after CategoryCode;
line ' ';
*** Run macro3 ***;
ODS _ALL_ CLOSE;
09-17-2014 08:47 AM
Two things, first you need to enclose macro variables in double quotes:
Otherwise they will not resolve.
The second point is when testing macros ensure you use options mlogic mprint symbolgen; so that you can see what everything is doing in your log, it makes it a lot easier.
09-17-2014 09:04 AM
Reading about it via Google - SAS.com - a little above my head but I understand why it's useful.
Since I'm new to this I write the SQL first and test the output to ensure data integrity then if needed create the macro.
09-17-2014 09:31 AM
Sets system options. Some of these could change paper layout, papersize, where to output to etc. The ones above are specifically for macro debugging. They create a lot more detail in the log, for example showing what the macro variable actually is at the point the code is run.
Need further help from the community? Please ask a new question.