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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 15381 views
  • 5 likes
  • 4 in conversation