BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
buechler66
Barite | Level 11

Is there a way to prevent my AREA column (which does get assigned a long character value for some observations) from automatically wrapping the text into a multiple lines within the cell?  (see the attached pic) 

 

I really don't want to have to manually format this column after the fact by turning off auto wrapping and the increasing the column width. 

 

I'd really appreciate some help with this.  Thanks.

 

/* EXPORT THE FILE TO XLS USING ODS */
OPTION MISSING = '';
ODS EXCEL FILE="C:\USERS\STEVEBUECHLER\BOX SYNC\IBM\USPS\HRC PAY DATA ANALYSIS\&SITE._HCR_PD_SUMMARY.XLSX";
PROC REPORT DATA=&SITE._HCR_SUMMARY_F;
COMPUTE AREA;
      IF FIND(AREA,"AREA SITE GRAND TOTAL") THEN
      CALL DEFINE(_ROW_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
                                          FOREGROUND=BLUE]");
ENDCOMP;
COMPUTE PAY_DATA_MONTH_CHR;
      IF FIND(PAY_DATA_MONTH_CHR,"HCR CONTRACT TOTAL") THEN
      CALL DEFINE(_ROW_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE ACTIVITY_DESCRIPTION;
      IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
      CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
	                                      FOREGROUND=DARKGREEN
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE FREQ;
      IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
      CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
	                                      FOREGROUND=DARKGREEN
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE PAY_AMOUNT;
      IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
      CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
	                                      FOREGROUND=DARKGREEN
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE RATE_PER_UNIT;
      IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
      CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
	                                      FOREGROUND=DARKGREEN
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COMPUTE UNITS;
      IF FIND(ACTIVITY_DESCRIPTION,"CONTRACT SUBTOTAL") THEN
      CALL DEFINE(_COL_, "STYLE", "STYLE=[FONTWEIGHT=BOLD
	                                      FOREGROUND=DARKGREEN
                                          BACKGROUND=HONEYDEW]");
ENDCOMP;
COLUMNS _ALL_;
RUN;
ODS EXCEL CLOSE;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

First thing I would try would be to add a DEFINE block for the variable

define area  / style(column)=[cellwidth= 1in] ;

should set the column width to one inch. You can us other units of measure like CM if you like and can use decimal values such a 1.75CM or 2.1IN .

View solution in original post

3 REPLIES 3
ballardw
Super User

First thing I would try would be to add a DEFINE block for the variable

define area  / style(column)=[cellwidth= 1in] ;

should set the column width to one inch. You can us other units of measure like CM if you like and can use decimal values such a 1.75CM or 2.1IN .

buechler66
Barite | Level 11
Great! I will give this a try first thing in the morning. I'll let you
know how it goes. Thanks so much.
buechler66
Barite | Level 11
That worked! Thanks so much for the help. Much appreciated.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 1158 views
  • 1 like
  • 2 in conversation