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