I am trying to assign page numbers for table of contents .like below : 2,7 are page numbers
Q1 ABCD.....................................................2 q2 XYZA......................................................7 |
@GG_DH wrote:
I am trying to assign page numbers for table of contents .like below : 2,7 are page numbers
Q1 ABCD.....................................................2
q2 XYZA......................................................7
First, it may help to provide how you are creating the output that should have the output. The basic approach varies a bit between the types of ODS output you create such as PDF or RTF. Some ODS destinations do not have the concept of page so this would get somewhat more problematic in that case.
Second, are you attempting to assign a specific value or have the page number that a SAS output object (table or graph) appears on as generated by code?
And what is Q1 and Q2 doing there?
ODS output is created as RTF.Q1 and Q2 are question numbers
Here is a very brief example of creating an RTF document with a table of contents. The first tricky part is that you have to tell Word (or likely other word processor or viewer program) to display the table. When you open the RTF file generated below you have to right click just below the "Table of Contents" text and select the "update table" from the menu. If that option is not there then you may need to try clicking somewhere left, right or closer the table of contents.
Specify a path for the output on your computer.
ods rtf file="<path>\junk.rtf" style=meadow contents toc_data; Title "Print of SASHELP.Class"; proc print data=sashelp.class; run; title "Age summary from Sashelp.class"; proc means data=sashelp.class; var age; run; title; ods rtf close;
The table of contents will generally hold things like procedure name, title statements and By group results. Some procedures have options like Description or Contents that may also generate output for the Table of contents.
You can change the default procedure text using the ODS PROCLABEL statement. Or ODS Proctitle/noproctitle to suppress procedure descriptions.
So, how do you intend to get "question numbers" into those?
And you may end up in Proc Document to assemble things if the defaults don't work quite as you want.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.