BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10

I am trying to produce a multiple-sheet workbook that shows the total number of bachelors, masters, and doctoral degrees for different degree classifications. For some reason, in the code example below, the CATEGORY and FIELD variables have extremely wide cells in the excel workbook, and I cannot find out how to reduce the size. I've attached a file (with no data) that shows the header widths. I've tried using the absolute_column_width option, but it produces no changes in the spreadsheet.  Thanks in advance. 

 

 

ODS TAGSETS.EXCELXP PATH='C:/Desktop' FILE="NEWDATA.XML" STYLE=statistical;
ods tagsets.ExcelXP options(orientation='Portrait'
							frozen_headers='yes'
							row_repeat='1-3'
							row_repeat='2'
							autofilter='2-3'
							fittopage='no'
							absolute_column_width='none'
							pages_fitwidth='1'
							pages_fitheight='100'
							width_fudge='0.8'
							sheet_interval='Bygroup'
							missing=' '
							);

PROC REPORT DATA=HAVE nowindows split='*';
	by year;
	COLUMN YEAR CATEGORY FIELD TOTAL_BACHELORS TOTAL_MASTERS TOTAL_DOCTORATES;
	DEFINE YEAR / display ;
	DEFINE CATEGORY / display ;
	DEFINE FIELD / display 'Field of Study' left style={just=l} ;
	DEFINE TOTAL_BACHELORS / display;
	DEFINE TOTAL_MASTERS / display;
	DEFINE TOTAL_DOCTORATES / display;
	BREAK AFTER YEAR/SUMMARIZE ;
	RUN; 
TITLE;
ods tagsets.ExcelXP close;
ods html;
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi, typically, you use a STYLE(COLUMN)= override. so instead of what you have (which is not really the way to code, I would recommend that you use the STYLE(COLUMN) and STYLE(HEADER) method of performing style overrides and use the WIDTH= attribute.

As an example (changing colors too):

	DEFINE CATEGORY / display
             style(column)={width=1.5in} ;
	DEFINE FIELD / display 'Field of Study' left 
             style(header)={just=l background=lightyellow} 
             style(column)={just=l width=1.5in background=peachpuff};



cynthia

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi, typically, you use a STYLE(COLUMN)= override. so instead of what you have (which is not really the way to code, I would recommend that you use the STYLE(COLUMN) and STYLE(HEADER) method of performing style overrides and use the WIDTH= attribute.

As an example (changing colors too):

	DEFINE CATEGORY / display
             style(column)={width=1.5in} ;
	DEFINE FIELD / display 'Field of Study' left 
             style(header)={just=l background=lightyellow} 
             style(column)={just=l width=1.5in background=peachpuff};



cynthia

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
  • 2577 views
  • 0 likes
  • 2 in conversation