The SAS Output Delivery System and reporting techniques

ODS tagsets for formating multiple sheets

Posts: 24

ODS tagsets for formating multiple sheets

I have been working on outputing multiple sheet/tabs by using ODS tagsets. it works fine so far except some formatting problems. My question is how to control title for each sheet - say,

1. every sheet has the same title at this point,

2. change font size

3. center desired columns - not all columns

I attached my code and output.

1.The title only shows in first and last sheets, not other sheets

2.colums were not centered as the program stated

3. font size is too big so even I did landscape, it still won't fit in the sheet

4. I named "quarter" as sheetname, but how can I get "quarter1" shown up instead of just "quarter"

Appreciate any help.

Thanks a bundle!!

Leigh R.

Posts: 9,370

Re: ODS tagsets for formating multiple sheets


  I'm not sure what you want, exactly. But aside from any other issues, the justification isn't always obvious unless you also increase the cell width. And, for the title/footnote issue, there's a Tech Support note about that issue:

  But more importantly, your code needs some correction -- with PROC PRINT and PROC REPORT, you need to use an (area) reference in your code. So instead of this:


you have:



See the code and output in the attached screenshot.

  I am not in a position to run new  code today, this is an example I already had. But for some of your other questions, here are some good links: (Tech Support note about Excelxp and BY group naming of sheets)


Posts: 24

Re: ODS tagsets for formating multiple sheets

Posted in reply to Cynthia_sas


Thank you for quick responce.

Following your suggestion, I got font sized changed, column centered. Just curious: I saw sometime people use ODS listing, sometimes not. When listing has to be used? or it is just a option.

Thank you again for you help.


Posts: 9,370

Re: ODS tagsets for formating multiple sheets


  ODS LISTING, if you use SAS Display Manager in interactive mode, is the same thing as the Output Window. If you use SAS Enterprise Guide, then LISTING is the choice for Text Output. The LISTING destination is the original way that SAS output was delivered.

  In the old mainframe days, we used to call it SYSOUT, because it was the way we referred to "system output". And so in Job Control Language (really the old dinosaur era of SAS), the statement to send your output directly to a printer was something like:


  In those old days, there was no ODS. So the only way your output could be produced was on a printer, where every character used the same amount of space on a page (which was a physical piece of paper) -- that's why LISTING controls for DATA _NULL_ like PUT @1 name @32 department @54 salary; were first invented - -because in the printer world there weren't any proportional spaced fonts.

  The LISTING destination is useful when you want to test code before you send it to ODS -- let's say you have some complex logic to work out and simple, (ugly) PROC PRINTs will verify that you have the correct logic working, but won't have the overhead of needing any additional ODS statements to answer the "is my logic correct" question. Or, your boss calls up and says "Quick, how many vendors do we have in Spain?" You don't need to create an ODS file to answer that question.

  Depending on your version of SAS, the LISTING window could be turned on automaticall (9.1.3, 9.2) or could be turned off (9.3). Also, if you use SAS Enterprise Guide, then LISTING is off, by default and either HTML or SASReport XML is turned on by default.

  When I write ODS code, I generally put housekeeping statements:


<all my other code>


around my program because I want to turn off the LISTING window before I start and turn it back on when I'm done. And I do that because I do a lot of complex program development where I am testing logic and I use LISTING for that. Then when my logic is "cooked" I send my output to ODS HTML, ODS RTF or ODS PDF.

  So, I can't really say that LISTING is an option. Using the LISTING destination is just one way of working with SAS. Now that you understand what it means and how it's used, you can experiment (or not). Most folks these days of SAS 9.3 and Enterprise Guide take all the defaults and they are happy that they never have to deal with the LISTING output or the LISTING window (plain text output is very plain and not as nice looking as ODS output). But you should at least understand what the control statements are and that you don't, usually, need to worry about them.


Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation