Convert SAS Program Files to PDF

Accepted Solution Solved
Reply
Contributor
Posts: 53
Accepted Solution

Convert SAS Program Files to PDF

Are there any quick methods available to convert multiple SAS program files into PDF documents?


Accepted Solutions
Solution
‎10-19-2012 12:56 PM
Super User
Posts: 19,868

Re: Convert SAS Program Files to PDF

Adobe Professional. Or if you have Word 2010 open them using Word and save as PDF, you could easily write a VBA macro to do that.

You could also probably write a macro to read in the program and then PDF it as well I'm guessing. 

View solution in original post


All Replies
Solution
‎10-19-2012 12:56 PM
Super User
Posts: 19,868

Re: Convert SAS Program Files to PDF

Adobe Professional. Or if you have Word 2010 open them using Word and save as PDF, you could easily write a VBA macro to do that.

You could also probably write a macro to read in the program and then PDF it as well I'm guessing. 

Respected Advisor
Posts: 3,156

Re: Convert SAS Program Files to PDF

ODS can come to your rescue: (works under 9.2)

filename sas "h:\sas.sas";

ods listing close;

ODS pdf file="H:\sas.pdf";

data _null_;

  infile sas ;

  input;

  temp=_infile_;

  file print ods;

  put _ods_;

run;

ODS pdf CLOSE;

ods listing;

And if you have multiple .sas under the same folder,  you can use pipe, filevar= etc to do conversion.

Haikuo

Respected Advisor
Posts: 3,156

Re: Convert SAS Program Files to PDF

Code for multiple .sas file pdf conversion, you may need to tweak some parameters to suit your environment.

filename codes pipe "dir  /b /s h:\temp\sascode\*.sas";

ods listing close;

ODS pdf file="H:\sas.pdf";

data _null_;

infile codes truncover;

input fname $40.;

infile dummy filevar=fname end=done;

do while(not done);

input ;

temp=_infile_;

file print ods;

  put _ods_;

end;

run;

ODS pdf CLOSE

ods listing;

Haikuo

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 2265 views
  • 8 likes
  • 3 in conversation