BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8
Can we output proc report to an image file like jpeg or bmp?
5 REPLIES 5
ArtC
Rhodochrosite | Level 12
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.
Ksharp
Super User
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
ArtC
Rhodochrosite | Level 12
This is new to me. Could you please share a simple example, I cannot see how to make it work.
Ksharp
Super User
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
Cynthia_sas
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 1435 views
  • 0 likes
  • 4 in conversation