Can we add some text in between two proc reports and print in one page ?
id | fname | lname | age |
1 | fname1 | lname1 | 25 |
2 | fname2 | lname2 | 26 |
3 | fname3 | lname3 | 27 |
Text in between "Table B display something like that " | |||
key | calc | ||
99 | 105 cal | ||
86 | 264 cal | ||
87 | 275 text |
I tried with title option but doesn't work because i have two proc reprots in one pdf and one page itself
<proc report code 1> ods text "This is some text that goes between that is not a title or footnote"; <proc report code 2>
Or
<proc report code 1> proc odstext p "This is some text that goes between that is not a title or footnote"; /* option more lines */ run; <proc report code 2>
But you will need an appropriate ODS PDF Startpage= setting of NEVER or NO, otherwise you are going to have default behavior of separate pages.
Yes , it helps .Thank you so much.
How do i add bold and center of the page options and color ?
@mmkr wrote:
Yes , it helps .Thank you so much.
How do i add bold and center of the page options and color ?
Style overrides.
In ODS Text the overrides come before the text. In Proc ODS TEXT they are an option at the end of the paragraph (the P statement)
ods escapechar='^'; ods pdf file="x:\junk.pdf" startpage=no; proc print data=sashelp.class(obs=3) noobs; run; ods pdf text= "^S={just=c fontweight=bold color=red} Some text to display."; proc print data=sashelp.class (firstobs=15) noobs; run; ods pdf close;
Last time I played with ODS TEXT if you do not have another procedure generating output following the ODS TEXT then that text did not appear in the output. Note that you have to set the ESCAPECHAR option and use that character before the S= (or Style=) to tell SAS that what follows is style over.
Note: any errors in the style names or options will have the literal text appear of the code with no style overrides applied.
ods pdf file="x:\junk2.pdf" startpage=no; proc print data=sashelp.class(obs=3) noobs; run; Proc odstext; p " Some text to display." /Style={just=c fontweight=bold color=red}; proc print data=sashelp.class (firstobs=15) noobs; run; ods pdf close;
Proc Odstext is has the styles follow the P as shown with the / to indicate the start of the style elements. Each P statement can have it's own set of overrides. It will display even if there is no following ods output (barring syntax errors and such of course).
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.
Ready to level-up your skills? Choose your own adventure.