BookmarkSubscribeRSS Feed
deleted_user
Not applicable
On the mainframe I want to control where the page number is in the title with a proc report. Can i save the page number to a variable and place it in the Title. And is there a pageof for the mainframe.
6 REPLIES 6
Cynthia_sas
SAS Super FREQ
Hi:
If you are creating standard LISTING output on the mainframe (such as that normally directed to a SYSOUT DD statement or the Display Manager LISTING window or a file with carriage control characters), then your page numbering capabilities are limited to what you can do with SAS Monospace or LISTING output, where the page number is in the upper right hand corner of the page -- when you use procedures such as PROC REPORT or PROC TABULATE, etc(exception -- see below).

You CAN create RTF and PDF files on the mainframe using the special page numbering functions
escapechar+{pageof} for RTF or
escapechar+{thispage}/{lastpage} for RTF and PDF
-- however, these result files would have to then be FTP'd or loaded onto a system where the software existed to render the RTF or PDF files -- an operating system with a Word Processor or Acrobat Reader.

THE EXCEPTION:
If you use DATA _NULL_ reporting techniques for LISTING output (such as that produced on the mainframe), where you take control of the entire output page and use techniques like N=PS with FILE PRINT and PUT and HEADER and LINESLEFT and you keep track of EVERY LINE that you write and perhaps even increment a page counter yourself and issue PUT _PAGE_ where you want it, then you CAN put a page number whereever you want. However, this means that you are NOT using regular SAS procedures to write the output -- you would be controlling ALL of the output yourself.

If the ultimate location for your files will be on other operating systems where Word or Acrobat Reader are available, then you might consider creating RTF and/or PDF files on the mainframe and using the special ESCAPECHAR functions for page numbering.

cynthia
deleted_user
Not applicable
that was what i was afraid of.
deleted_user
Not applicable
One last question. so when i use the NUMBER options and i have several PROC REPORTS in one program and i use pageno=1 for each one. i only get the numbering intermittently on some reports and not others.
Cynthia_sas
SAS Super FREQ
Hi,
I'm not exactly sure what you mean by intermittent page numbers -- when you actually send the output to the printer or when you look at the output in the LISTING file??? Or in the RTF or PDF file?? At any rate, when I run this code:
[pre]
options number pageno=1 ls=72 ps=55;

proc report data=sashelp.shoes(obs=200) nowd;
title 'proc report 1';
column region product sales;
run;

options pageno=1;

proc report data=sashelp.class nowd;
title 'proc report 2';
column name age height;
run;
[/pre]

I get page numbers 1-4 for the first PROC REPORT and page number 1 for the second PROC REPORT. For a total of 5 pages. I have a number on every page.

You might consider contacting Tech Support, as they can look at your program and make specific suggestions about what might be causing your page numbering to be intermittent.
http://support.sas.com/techsup/contact/index.html

cynthia
deleted_user
Not applicable
i did identify why it is not working. i am using a PROC PRINTTO command which is when it doesn't work. if i take it out and just let it go to the SASLIST the page numbering workes correctly.
Cynthia_sas
SAS Super FREQ
You still might want to check with Tech Support. When I use PROC PRINTTO (on Windows), I still see page numbers in my output file. You might check with Tech Support about the proper DCB characteristics for the PROC PRINTTO file. If you expect it to have carriage control characters, I think you have to use RECFM=VBA and DSORG=PS ... or something like that when you allocate the PRINTTO file. (My mainframe days are longer ago than the original Star Wars....in a galaxy far, far, away.)

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 6 replies
  • 896 views
  • 0 likes
  • 2 in conversation