The runMacro Stored Process

From sasCommunity
Jump to: navigation, search

The complete source code for the runMacro Stored Process as discussed on the blog entries

on Jurassic SAS© in the BI/EBI World

*ProcessBody;
 
options sasautos=("/Projects/&Project/Macros"
                  "/Projects/Tools/Macros"
                  sasautos);
 
/*ODS PATH statement pointing to the template store*/
 
%let _odsDest = %upcase(&_odsdest);
data _null_;
 if "&_odsdest" = 'EXCEL' then
 do;
   rc = stpsrv_header('Content-type','application/vnd.ms-excel');
   call symput('_odsDest','HTML');
 end;
 else if "&_odsdest" = 'TAGSETS.EXCELXP' then
 do;
   rc = stpsrv_header('Content-type','application/vnd.ms-excel');
   rc = stpsrv_header('Content-disposition','attachment; filename="_.xml"');
 end;
 else if "&_odsdest" = 'TAGSETS.TABLEEDITOR' then
    call symput('_odsOptions',
                "options(" ||
                strip(symget('_odsOptions') ||
                " pageheight='&pageheight'" ||
                " pagewidth='&pagewidth'" ||
                " sort='&sort'" ||
                " frozen_rowheaders='&frozen_rowheaders'" ||
                " frozen_headers='&frozen_headers')"));
run;
 
%stpBegin;
%put NOTE: Execute macro &macroToRun..;
%&macroToRun
%stpEnd;