DATA Step, Macro, Functions and more

proc report to image file

Reply
Super Contributor
Posts: 673

proc report to image file

Can we output proc report to an image file like jpeg or bmp?
Valued Guide
Posts: 634

Re: proc report to image file

I do not know of a way to do this directly. Certainly there are screen capture programs that could be used, but it would be a manual operation. Would not a PDF file answer just as well? It too would be scalable.
Super User
Posts: 10,023

Re: proc report to image file

Yes.
You can refer to ' proc printto ' which can change the result of proc report into jpg that looks like exactly the output window of SAS.


Ksharp
Valued Guide
Posts: 634

Re: proc report to image file

This is new to me. Could you please share a simple example, I cannot see how to make it work.
Super User
Posts: 10,023

Re: proc report to image file

Ok. I finally find it.
But forget also need 'proc gprint';
the following is the code i steal from somewhere.

[pre]
filename logtxt 'c:\temp\report.txt';
goptions reset=all;
proc printto print=logtxt;
run;
proc report data=sashelp.class nowd;
run;
proc printto;
run;
proc gprint fileref=logtxt name='logGraph';
run;
[/pre]



Ksharp
SAS Super FREQ
Posts: 8,864

Re: proc report to image file

And the downside of this approach is that in this day and age of proportional fonts and pretty colors, hardly anyone wants a snapshot of what they would see in the LISTING window. Also, if you change the output to use SASHELP.SHOES instead of SASHELP.CLASS, you will find that for multi-page output, the results are generally undesirable and you end up with multiple GSEG catalog entries for each "page" created.

I think Art's PDF idea is a better idea for capturing a virtually unchangeable, but better looking view of the output. Alternately, making a PostScript file ensures that you have a file that can ONLY be printed -- generally, unless you have some kind of PostScript rendering software (like GhostView) you can't even open a PostScript file, you can only print it.

Since the OP did not say what the reason was for wanting an image file of PROC REPORT or how that image file was going to be used, it's possible that neither of these approaches will satisfy the need....whatever it is.

cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 211 views
  • 0 likes
  • 4 in conversation