BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

 am running proc reports and export it into Excel file.

In one sheet I see that row height is too big  (Right click in excel ---Row Height----I see  the height is 29).

I want to modify the row height to 15.

I also see that DIF_FROM_PREV_MON  looks bad when it is negative and can see only one bracket ) instead of two ()

 

Here is photo how how it looks like:

Ronein_0-1746812671962.png

Here is a photo how I want it to look :

Ronein_1-1746812746278.png

 

Here is the proc report code :

I export it using ODS EXCEL.

What change should I do in my proc report code to solve the 2 problems I mentioned:

1- reduce row height to 15

2- get two brackets in negative number (Now i see only one)

proc report data=S2 missing nowd;
column 
Ind
YYMM

("NR"
x	
w
z	
r
t)

("PCT"
P_w
P_z
P_r
P_t)

("DIF_FROM_PREV_MON"
P_Dif_w
P_Dif_z
P_Dif_r
P_Dif_t)
;
define IND /  DISPLAY;
define YYMM /  DISPLAY;

define x /  DISPLAY f=comma32.;
define w /  DISPLAY  f=comma32.;
define z /  DISPLAY  f=comma32.;
define r /  DISPLAY  f=comma32.; 
define t /  DISPLAY  f=comma32.;

define P_w /  DISPLAY;
define P_z /  DISPLAY;
define P_r /  DISPLAY;
define P_t /  DISPLAY;

define P_Dif_w / DISPLAY;
define P_Dif_z /  DISPLAY;
define P_Dif_r /  DISPLAY;
define P_Dif_t /  DISPLAY;

	compute IND;
		if IND = 0 then
			do;
				call define (_col_,"style", "style={background=lightgreen}");
			end;
		else if IND =1 then
			do;
				call define (_col_,"style", "style={background=lightred}");
			end;
	endcomp;
Run;
3 REPLIES 3
Tom
Super User Tom
Super User

Looks to me your issue is with the column width, not the row height.

In your first picture the PCT*W column is wrapping into two lines, which is why it needed to make the row taller.

Ronein
Meteorite | Level 14
Thanks.
Should I use ABSOLUTE_COLUMN_WIDTH ?
Kathryn_SAS
SAS Employee

You can try ABSOLUTE_COLUMN_WIDTH. The following will make all column widths 20. If you want to customize each column width, you would need to add more values separated by commas for each column.

ods excel file='test.xlsx'
 options(absolute_column_width='20');

sas-innovate-white.png

Missed SAS Innovate in Orlando?

Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.

 

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