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
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 1 reply
  • 2095 views
  • 0 likes
  • 2 in conversation