BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BlueNose
Quartz | Level 8

Hello,

 

At the end of my SAS programm, I have an ODS section where I send tables to an rtf file (all together). I use PROC TABULATE and PROC REPORT. If I need a part of an output (from a model for example), I save it as a dataset and then use TABULATE or REPORT to send it to the same rtf with the rest of the output. If I want a plot, easy, inside the ODS section I use SGPLOT or another procedure.

 

Now I want a MOSAIC plot. I couldn't find an easy way of plotting one besides using PROC FREQ. The question is, how do I output the plot and only the plot, to an rtf file ? In other words, can I tell SAS not to print anything from the PROC FREQ apart from the MOSAIC plot ?

 

Thank you !

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

ods graphics on;
ods select MosaicPlot;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;

View solution in original post

6 REPLIES 6
Ksharp
Super User

ods graphics on;
ods select MosaicPlot;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;
BlueNose
Quartz | Level 8
Thank you. Since I am outputting it, is it possible to delete the automatic title of the plot ? I will add my own using title2 ''....
Ksharp
Super User

Well, I am not expert of ODS Graphic. But you could try this :

 


ods select MosaicPlot;

title1 'ssssssss';
title2 'xxxxxxxxx';
ods text=' ' ;
proc freq data=sashelp.class ;
table sex*age/plot(only)=mosaic;
run;
BlueNose
Quartz | Level 8

Thank you ! I tried it and it didn't delete the title from the plot. When I say title, I don't mean the title of the output, I mean the actual title of the plot, inside the white square of the plot. I am not sure it's even possible.

Tim_SAS
Barite | Level 11

Check the NOGTITLE option on the ODS RTF statement.

Rick_SAS
SAS Super FREQ

Use the %MODTMPLT macro, which is described in the SAS/STAT documentation:

title;    /* clear the title */
%modtmplt(options=replace, template=Base.Freq.Graphics.MosaicPlot, steps=t)
proc freq data=sashelp.class;
tables sex*age / plots(only)=MosaicPlot;
run;

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
  • 6 replies
  • 12853 views
  • 5 likes
  • 4 in conversation