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

I am creating a workbook and the first page has directions that I've created using PROC ODSTEXT. Unfortunately, no matter what option I use the text continues to wrap. Can someone please tell me how to stop the text wrapping? I've tried FLOW, setting the column width, tagattr etc...

 

ODS EXCEL FILE = "filedestination.xlsx" OPTIONS (TITLE_FOOTNOTE_NOBREAK='YES' SHEET_NAME= "INSTRUCTIONS" EMBEDDED_TITLES='YES' Absolute_column_width = '175pt' absolute_row_height = "20pt" FLOW='DATA, TABLES, TEXT');

TITLE; 

PROC ODSTEXT;

 P '1. REVIEW THE ITEM TO RECONCILE TAB IN THE WORKBOOK PROVIDED ON XXX WEBSITE.'/style={tagattr='WrapText:0' fontsize=12pt};

 P ' ';

 P '2. REVIEW COLUMN X TO IDENTIFY ANY ITEMS DEEMED "LEAKAGE" PER DETERMINED LOGIC.' /style={tagattr='WrapText:0' fontsize=12pt};

 P ' ';

 P '3. FOR ANY SERVICES YOU FEEL SHOULD NOT BE INCLUDED, PLEASE NOTE THAT IN THE SPREADSHEET. THOSE SERVICES WILL BE REVIEWED BY A MEMBER OF OUR CLINICAL STAFF.'/style={tagattr='WrapText:0' fontsize=12pt};

 

 RUN;

 ods excel close;

 

SAS Base 9.4 TS Level 1M6

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  I typically like to use PROC REPORT for title sheets or instruction sheets like this, especially when I need to make sure that the cellwidth is respected. I still used the TAGATTR, but I find cellwidth and height just seem to work better for me with PROC REPORT. I generated this output:

Cynthia_sas_0-1719279201790.png

 

Using this code:

data instructions;
  length instructions $200;
  lineno = 1;
  instructions = '1. REVIEW THE ITEM TO RECONCILE TAB IN THE WORKBOOK PROVIDED ON XXX WEBSITE.';
  output;
  lineno = 2;
  instructions = ' ';
  output;
  lineno = 3;
  instructions =  '2. REVIEW COLUMN X TO IDENTIFY ANY ITEMS DEEMED "LEAKAGE" PER DETERMINED LOGIC.';
  output;
  lineno = 4;
  instructions=' ';
  output;
  lineno=5;
  instructions='3. FOR ANY SERVICES YOU FEEL SHOULD NOT BE INCLUDED, PLEASE NOTE THAT IN THE SPREADSHEET. THOSE SERVICES WILL BE REVIEWED BY A MEMBER OF OUR CLINICAL STAFF.';
  output;
 RUN;

title; footnote;
ODS EXCEL FILE = "c:\temp\instructions.xlsx" 
   OPTIONS (SHEET_NAME= "INSTRUCTIONS" orientation='landscape');

PROC report data=instructions noheader;
  column lineno instructions;
  define lineno/ order noprint;
  define instructions / display 
         style(column)={height-.5in cellwidth=10in fontsize=12pt cellpadding=7px tagattr='WrapText:0'};
 RUN;

 ods excel close;

All measurements like 10in or .5 in are converted by Excel into some unit of measure that seems opaque to me. However, I generally just fiddle around until I find a cellwidth that works for my text. I started at 8in and ended at 10. I fiddled with cellpadding, I probably didn't need it. The ability to generate PROC  REPORT output without column headers using the NOHEADER option really helps with an instructions page like this.

Cynthia

View solution in original post

5 REPLIES 5
data_null__
Jade | Level 19

Can you show example what you want?  Maybe make it by hand and show a picture.  Most folks don't like to open XLSX from external source.

Ksharp
Super User

Using style WRAP:NO instead of wraptext:0

 


ODS EXCEL FILE = "c:\temp\filedestination.xlsx" 
OPTIONS (TITLE_FOOTNOTE_NOBREAK='YES' 
SHEET_NAME= "INSTRUCTIONS" EMBEDDED_TITLES='YES'
Absolute_column_width = '175pt' 
absolute_row_height = "20pt" 
FLOW='DATA, TABLES, TEXT');

TITLE; 

PROC ODSTEXT;

 P '1. REVIEW THE ITEM TO RECONCILE TAB IN THE WORKBOOK PROVIDED ON XXX WEBSITE.'/style={tagattr='Wrap:no' fontsize=12pt};

 P ' ';

 P '2. REVIEW COLUMN X TO IDENTIFY ANY ITEMS DEEMED "LEAKAGE" PER DETERMINED LOGIC.' /style={tagattr='Wrap:no' fontsize=12pt};

 P ' ';

 P '3. FOR ANY SERVICES YOU FEEL SHOULD NOT BE INCLUDED, PLEASE NOTE THAT IN THE SPREADSHEET. THOSE SERVICES WILL BE REVIEWED BY A MEMBER OF OUR CLINICAL STAFF.'/style={tagattr='Wrap:no' fontsize=12pt};


 RUN;

 ods excel close;

Ksharp_0-1719278895745.png

 

SMarieH1521
Calcite | Level 5

KSharp, this solution worked too! Thank you!

Cynthia_sas
SAS Super FREQ

Hi:

  I typically like to use PROC REPORT for title sheets or instruction sheets like this, especially when I need to make sure that the cellwidth is respected. I still used the TAGATTR, but I find cellwidth and height just seem to work better for me with PROC REPORT. I generated this output:

Cynthia_sas_0-1719279201790.png

 

Using this code:

data instructions;
  length instructions $200;
  lineno = 1;
  instructions = '1. REVIEW THE ITEM TO RECONCILE TAB IN THE WORKBOOK PROVIDED ON XXX WEBSITE.';
  output;
  lineno = 2;
  instructions = ' ';
  output;
  lineno = 3;
  instructions =  '2. REVIEW COLUMN X TO IDENTIFY ANY ITEMS DEEMED "LEAKAGE" PER DETERMINED LOGIC.';
  output;
  lineno = 4;
  instructions=' ';
  output;
  lineno=5;
  instructions='3. FOR ANY SERVICES YOU FEEL SHOULD NOT BE INCLUDED, PLEASE NOTE THAT IN THE SPREADSHEET. THOSE SERVICES WILL BE REVIEWED BY A MEMBER OF OUR CLINICAL STAFF.';
  output;
 RUN;

title; footnote;
ODS EXCEL FILE = "c:\temp\instructions.xlsx" 
   OPTIONS (SHEET_NAME= "INSTRUCTIONS" orientation='landscape');

PROC report data=instructions noheader;
  column lineno instructions;
  define lineno/ order noprint;
  define instructions / display 
         style(column)={height-.5in cellwidth=10in fontsize=12pt cellpadding=7px tagattr='WrapText:0'};
 RUN;

 ods excel close;

All measurements like 10in or .5 in are converted by Excel into some unit of measure that seems opaque to me. However, I generally just fiddle around until I find a cellwidth that works for my text. I started at 8in and ended at 10. I fiddled with cellpadding, I probably didn't need it. The ability to generate PROC  REPORT output without column headers using the NOHEADER option really helps with an instructions page like this.

Cynthia

SMarieH1521
Calcite | Level 5

Thank you, Cynthia! That worked!

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
  • 5 replies
  • 289 views
  • 1 like
  • 4 in conversation