BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Anita_n
Pyrite | Level 9

Dear all,

Is it possible to format the page number option in system option?

 

options nodate number nobyline

can I change the size, color, etc of the numbers printed?

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26

Hi:

  It is possible to change the page number formatting, but not, as you envision, in a system option. The page number is controlled by the style template used for the destination. So your options are:

1) turn page numbering off and use ODS ESCAPECHAR THISPAGE function in a title statement and use TITLE options to alter the page number

or

2) change the style template.

  Both methods are shown below:

Method 1 -- use ODS ESCAPECHAR and TITLE statement

Cynthia_sas_1-1673622720018.png

 

Method 2 -- use PROC TEMPLATE

Cynthia_sas_0-1673622608801.png

  I think that Method 1 is easier for beginners. For method 2 to work, the PAGENO style attribute had to be altered to add color and font in the template. And, the STYLE = option had to be added to the ODS PDF statement.

 

Hope this helps,

Cynthia

View solution in original post

5 REPLIES 5
Cynthia_sas
Diamond | Level 26

Hi:

  It is possible to change the page number formatting, but not, as you envision, in a system option. The page number is controlled by the style template used for the destination. So your options are:

1) turn page numbering off and use ODS ESCAPECHAR THISPAGE function in a title statement and use TITLE options to alter the page number

or

2) change the style template.

  Both methods are shown below:

Method 1 -- use ODS ESCAPECHAR and TITLE statement

Cynthia_sas_1-1673622720018.png

 

Method 2 -- use PROC TEMPLATE

Cynthia_sas_0-1673622608801.png

  I think that Method 1 is easier for beginners. For method 2 to work, the PAGENO style attribute had to be altered to add color and font in the template. And, the STYLE = option had to be added to the ODS PDF statement.

 

Hope this helps,

Cynthia

Anita_n
Pyrite | Level 9

Thankyou @Cynthia_sas ,

I tried that with this code

options nodate nonumber nobyline;
ods pdf file="test.pdf"; ods graphics /reset noborder width=10in height=8.5in ; ods ecapechar='^'; title1 color=dimgray h=6pt bold j=r "Page ^{thispage} of ^{lastpage}"; title2 color=dimgray h=6pt bold j=c "My title"; proc sgpanel data=mydata; ........................; run; title1; title2; ods pdf close;

but am not getting the desired results:

this is what I get:

Anita_n_0-1673624229789.png

the number is not displayed

Cynthia_sas
Diamond | Level 26

Hi: Sorry, I must have missed that you were doing graphics. Method 1 worked for me when I did this:

Cynthia_sas_0-1673663369635.png

 

 

  You have to use the ODS PDF option to allow ODS to control the title. It is just NOGTITLE (which says don't put the title inside the graph, put it outside the graph in the ODS file).

 

Cynthia

Anita_n
Pyrite | Level 9

@Cynthia_sas The second method worked for me thankyou

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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