**********************************************; ** MACRO: PDFMAC ; ** IN: Location of SAS program to run ; ** OUT: Location of where to route output ; ** stored in .PDF format. Use .pdf ; ** extension. ; ** INPGM: Macro variable to specify IN ; ** OUTPUT: Macro variable to specify OUT ; **********************************************; %MACRO PDFMAC(IN=,OUT=); *uncomment to debug program; *options sgen mprint mlogic source source2; ods listing close; *debug options; options sgen mprint mlogic source source2; filename srcpgm "&INPGM"; *set ODS to write to output PDF file; ods pdf body="&OUTPUT"; *read the source code and write to PDF file; TITLE 'Code and Output for PLOTS_LONG'; data _null_; infile srcpgm truncover; input record $200.; *route source statements to PDF file; file print; put _infile_; run; *execute the source code and write output to pdf file; %include srcpgm; *close ODS to stop writing; ods pdf close; ods listing; %MEND PDFMAC; %let INPGM=c:\1datalap\papers\walls_sork\RUS_DESCRIPTIVES.sas; %let OUTPUT=c:\1datalap\papers\walls_sork\RUS_DESCRIP.pdf; %PDFMAC(IN=&INPGM,OUT=&OUTPUT);