BookmarkSubscribeRSS Feed
loredana_cornea
Obsidian | Level 7

Hello,

I remember long time ago, when I started using SAS there was an option that permitted the output to be written on different pages.

I mean, a procedure will give you several tables and it would help a lot to have them each on a separate page, so I can print them afterwards.

I know there are other ways of doing this, using ODS, but I really like the format I'm getting and I don't need anything complicated. Plus I don't have the time to make it super pretty, so if you have any idea what that option is, I would greatly appreciate your intervention.

EDIT:

I'm sorry for not being very specific on this subject. I'm trying to print the output of:

proc corr data=db5 pearson kendall;

     var &var_quant;

run;

I have 3 tables: Simple Statistics, Pearson Matrix, Kendall matrix.

I need to print them on paper.

I would love to go in the Results Viewer and just print the results (for I've changed viewer preferences and I really like the format), but I would like to print each table on a different paper sheet.

Can I do that?

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Hi,

You would need to clarify what you want.  HTML does not have any concept of "pages", it is a flat text file with some markup tags which indicate how a browser is to render the output.  If you want paged output then you need to look at a destination which handles the concept of "pages", i.e. Word, RTF, PDF.  You can retain your output format and style (style should be a template so can be applied to any ods destination, output format, you may need to tweak somewhat).

ods rtf file="abc.rtf";

ods escapechar="^";

title "A title";

footnote "Page ^{firstpage} of ^{lastpage}";

proc report data=somedata;

     columns _all_;

     define...;

run;

ods rtf close;

Ksharp
Super User

ods html file='' options(page_break='no');  ????

Cynthia_sas
SAS Super FREQ

Hi:

As RW9 explained, correctly, there is no concept of "pages" in ODS HTML -- so the code in the previous posting from Xia  options(page_break='no') is completely irrelevant for ODS HTML and not a valid sub-option.

  By default, every SAS procedure starts on a separate page -- either a logical page (in HTML) or a physical page. A logical page in HTML is indicated by a horizontal rule (a faint line) that you see between 2 procedure outputs. For RTF and PDF destinations, a new logical page is the same as a physical page. So a 1 page PROC PRINT report followed by a 1 page PROC MEANS report would be on page 1 and page 2 respectively. But for HTML, the PROC PRINT would be at the top of the browser window and then you would see a horizontal rule, and then the PROC MEANS would be under the PROC PRINT report. There are no physical pages or page numbers for HTML output.

  There are some procedures that have internal "paging" controls -- like TABULATE and PRINT and REPORT -- but again, how those pages appear will depend on the final destination.

  There is an option called NEWFILE= that allows you to make a separate output file for EACH "starting point". For example: NEWFILE=OUTPUT would create 1 report FILE for every output object created by a procedure. NEWFILE=BYGROUP would create 1 report file for every BY group; NEWFILE=PROC would create a new file for every procedure output (the default behavior). But a physical output file would not be the same as a "page".

  The OP says he/she really likes the format being created  but doesn't show code, doesn't tell us the destination he/she wants and doesn't tell us how he/she is getting what they are getting, so without more information, it is hard for anyone to give the

OP any constructive help.

cynthia

Cynthia_sas
SAS Super FREQ

Hi,

You're right. My bad. but all that sub-option does is remove the horizontal rule and it only works in some versions of SAS, starting in 9.2, I think. That's not the same as writing to DIFFERENT pages. If you had 2 small tables, then with ODS HTML and the sub-options set to 'no', if you printed from your browser, both small tables would appear on the SAME physical page as printed by the browser/printer interface. That is NOT what the OP said he wanted. The suboption for 'yes" just restores the horizontal rule between the 2 procedure outputs. Sometimes the horizontal rule is interpreted as a page break by the browser, but sometimes it is not, so it would be better NOT to suppress the horizontal rule if he wants HTML output on separate pages. I think that if paging and page numbers are important, then PDF or RTF are better bets.

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