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

Hi all,

 

I'm trying to write a report. I created custom bits of ods text to include some breaks between sections. But for some reason they fail to load, while I've used them successfully in the past. I don't know what different in my current code/report for it to not print the text.

 

proc template; 
define style styles.wuss2019; 
parent=styles.sasdocprinter; 
class usertext from systemtitle / font=("Arial",11pt);
style paragraph from usertext; 
end;
run;
ods escapechar="^";
 

title1 "";
ods text="^S={fontweight=bold} Analysis";
ods text="^S={fontweight=bold} First pass at a report. Feedback much appreciated";
ods text="^S={fontweight=bold} Generated on 08/12/2021";



/* Set dataset so we don't overwrite the original */
DATA mydat;
  SET sashelp.cars;
RUN;

/*----*/


ods text="^S={fontweight=bold} --------------------------------------------------------------------------------------------";


/*----*/

ods text="^S={fontweight=bold} Main";

ods text="^S={fontweight=bold} --------------------------------------------------------------------------------------------";


PROC GCHART DATA=mydat
;
	HBAR 
	 type

 /
	CLIPREF
FRAME	TYPE=FREQ
	COUTLINE=BLACK
	MAXIS=AXIS1
	RAXIS=AXIS2
;

RUN;





ods text="^S={fontweight=bold} --------------------------------------------------------------------------------------------";




ods text="^S={fontweight=bold} Second";

ods text="^S={fontweight=bold} --------------------------------------------------------------------------------------------";


proc freq data=mydat;
	tables type;
run;

So the "Main" bit prints fine. The "Second" bit is not printed. I don't necessarily need to use this ods stuff, I just need to create clear distinctions between sections of the analysis in my report. I've tried titles, but these print on all pages of the report. Anything that can help clearly differentiate sections is useful. 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It is not at all obvious to me what is meant by: "So the "Main" bit prints fine. The "Second" bit is not printed."

 

Titles should be able to turn on/off as needed. Set the title in/before a procedure that generates output and then turn off with: Title ;  not Title " "; that creates a title.

 

Proc Gchart requires a QUIT; to end the procedure. So likely you have an issue with the ODS Text following Gchart because of the missing Quit. Might be time to learn Proc Sgplot.

 

Another option is Proc ODSTEXT which uses somewhat different approach but I find it a tad nicer for doing blocks of text boiler plate in document output.

 

You don't show what active ODS destination you are sending this output to, which makes a difference sometimes.

View solution in original post

1 REPLY 1
ballardw
Super User

It is not at all obvious to me what is meant by: "So the "Main" bit prints fine. The "Second" bit is not printed."

 

Titles should be able to turn on/off as needed. Set the title in/before a procedure that generates output and then turn off with: Title ;  not Title " "; that creates a title.

 

Proc Gchart requires a QUIT; to end the procedure. So likely you have an issue with the ODS Text following Gchart because of the missing Quit. Might be time to learn Proc Sgplot.

 

Another option is Proc ODSTEXT which uses somewhat different approach but I find it a tad nicer for doing blocks of text boiler plate in document output.

 

You don't show what active ODS destination you are sending this output to, which makes a difference sometimes.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1 reply
  • 192 views
  • 1 like
  • 2 in conversation