BookmarkSubscribeRSS Feed
Rajeeva
Calcite | Level 5

I am creating the EXCEL report using SAS ODS HTML. Somehow the title1 and title2 are wrapping up in column A in row 1 and row 2. Somebody suggested me that  there's a SAS employee named Cynthia who knows ODS inside and out, so maybe she'll check it out.  My code looks like this:

 

%MACRO print_report ;
         

          %LET myear  = 2015;
          %LET mpart2 = TABLE R37. Number of nonfatal occupational injuries and illnesses involving;
          %LET mpart3 = days away from work^{super 1} by industry and age of worker, private industry,;
           
          title1 "Table with row headers in column A and column headers in rows 2 through 3";
          title2 "&mpart2 &mpart3 &myear";

 

 

Cynthia, if you are looking at my question, can you please help me out.  OR ANYBODY ELSE.......

Thanks.

 

 

 

1 REPLY 1
Cynthia_sas
Diamond | Level 26

Hi, I posted a response over here:
https://communities.sas.com/t5/ODS-and-Base-Reporting/How-to-remove-the-blank-rows-from-EXCEL-report...

You did not post the rest of your report. The macro program %print_report does NOT do anything by itself. You only show your titles. You don't show any code or what the rest of your report program looks like, how many columns you have on the report or how wide the report is.
 
As you can see from my example, below, HTML4 treats the title the worst. The other 3 destinations treat it better. I think that both ODS TAGSETS.EXCELXP and ODS EXCEL have ways to control the titles and how many columns that they span. You'd have to check more in the documentation.

I still recommend that you switch to something other than ODS HTML.
 
cynthiatitle_excel.png

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 2555 views
  • 0 likes
  • 2 in conversation