BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Batman
Quartz | Level 8

The following code produces titles that wrap and a merge cells.   Can I prevent both?

 

35 ods excel options (Sheet_name="Table" sheet_interval='NOW' row_heights='40,0'
36 ABSOLUTE_COLUMN_WIDTH = '10,30,30' flow="header,data");
37
38 proc report data=Daily3;
39 col Date Tot_Avg Adult_Cov;
40 define Date / display 'Date';
41 define Tot_Avg / display format=comma8. 'Number of patients hospitalized with confirmed COVID-19 (7 day average)';
42 define Adult_Cov / display format=comma8. 'Number of hospitals reporting on adult patients with confirmed COVID';
43 /*AP implies data should start on August 1, 2020*/
44 where Date ge mdy(8,1,2020);
45 Title 'Analysis of COVID-19 Hospitalizations Data';
46 Title2 'Through May 2023';
47 Title3 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median1 (thru &max_date1)";
48 Title4 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median2 (thru &max_date2)";
49 Title5 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median3 (thru &max_date3)";
50 run;

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi: As I show in my example, my titles are NOT wrapping. So I would recommend that you remove all the suboptions and width controls out of your syntax and start with code more like the code I show. Then introduce only one change at a time until you find the one that's causing the wrapping. Without data, it is impossible to run your code. And since I can show that the TITLES don't wrap with taking all the defaults on width and row heights, there's something in your options that is conflicting and causing the issue.
Cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:
Are you showing all of your code? I don't see any embedded_titles suboption, so I'm not sure where your titles are wrapping or not wrapping.
Cynthia

 

Perhaps you are trying to over-control the cellwidths and row heights. When I simplify all the suboptions and include the embedded_titles suboption, I am not seeing any wrapping, as shown below:

Cynthia_sas_0-1683657260853.png

As you can tell, I used SASHELP.PRDSALE for my example because it has a date variable that I can use for the first column. I made fake values for the macro variables in the TITLE statements.

 

Batman
Quartz | Level 8
Here is the full code between the ods statements


ods excel file=[output URL];
options (absolute_column_width='80'
embedded_titles='yes' embedded_footnotes='yes' sheet_name='Info'
sheet_interval='none' flow='tables');

%info

ods excel options (Sheet_name="Table" sheet_interval='NOW' row_heights='40,0'
ABSOLUTE_COLUMN_WIDTH = '10,30,30' flow="header,data");

proc report data=Daily3;
col Date Tot_Avg Adult_Cov;
define Date / display 'Date';
define Tot_Avg / display format=comma8. 'Number of patients hospitalized with confirmed COVID-19 (7 day average)';
define Adult_Cov / display format=comma8. 'Number of hospitals reporting on adult patients with confirmed COVID';
/*AP implies data should start on August 1, 2020*/
where Date ge mdy(8,1,2020);
Title 'Analysis of COVID-19 Hospitalizations Data';
Title2 'Through May 2023';
Title3 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median1 (thru &max_date1)";
Title4 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median2 (thru &max_date2)";
Title5 "Median number of patients hospitalized with confirmed COVID-19 (7 day average):&median3 (thru &max_date3)";
run;

ods excel close;




Cynthia_sas
SAS Super FREQ
Hi: As I show in my example, my titles are NOT wrapping. So I would recommend that you remove all the suboptions and width controls out of your syntax and start with code more like the code I show. Then introduce only one change at a time until you find the one that's causing the wrapping. Without data, it is impossible to run your code. And since I can show that the TITLES don't wrap with taking all the defaults on width and row heights, there's something in your options that is conflicting and causing the issue.
Cynthia

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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