BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Nasser_DRMCP
Lapis Lazuli | Level 10
data TEST ;
col1 = "Exécution amiable - retour huissier" ;
col2 = "Exécution amiable - retour huissier" ;
col3 = "Exécution amiable - retour huissier" ;
output ;
col1 = "Exécution amiable - retour huissier" ;
col2 = "Exécution amiable - retour huissier" ;
col3 = "Exécution amiable - retour huissier" ;
output ;
run ;



ODS LISTING CLOSE;
ODS EXCEL FILE="$GRPFPU/REQUETES_PROD/TEST_NASSER.xlsx" STYLE=HTMLBlue;
ODS Excel options (SHEET_NAME = "Base"
                   EMBEDDED_TITLES = "off"
                   FROZEN_HEADERS = "yes"
                   AUTOFILTER = "all"
                   absolute_row_height='30'
                   ROW_HEIGHTS="0,20,0,0,0,0,0");


PROC REPORT DATA=TEST NOWD
    STYLE(header)=[background=CX9BC2E6 foreground=white]
    STYLE(column)=[cellwidth=3cm ]
	;
    COLUMN
      col1 col2 col3;

RUN;
ODS Excel CLOSE;
ODS LISTING;

hello,

by executing this code, I note that there is a return cariage indisde the cell excel.

how could I prevent this ?

thanks a lot in advance for your help

kind regards

Nasser

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User
PROC REPORT DATA=TEST NOWD
    STYLE(header)=[background=CX9BC2E6 foreground=white]
    STYLE(column)=[cellwidth=3cm ]
 ;
    COLUMN
      col1 col2 col3;
define _all_/style={tagattr='wrap:no'};
RUN;

Ksharp_0-1671018054649.png

 

微信图片_20221214194158.png

View solution in original post

14 REPLIES 14
data_null__
Jade | Level 19

You need the FLOW option.

 

FLOW=<"cell-names", "DATA", "HEADERS", "ROWHEADERS", "TABLES", "TEXT" >

specifies that a designated Worksheet area enables Wrap Text and disables newline character insertion. Excel wraps the text to the column width.

cell-names

enables Wrap Text for a single cell such as “A12” or a cell range such as “C1:E4”.

DATA

enables Wrap Text for table data cells.

HEADERS

enables Wrap Text in table column headers.

Alias HEADER

ROWHEADERS

enables Wrap Text for table row headers.

Alias ROWHEADER

TABLES

enables Wrap Text for all parts of a table: HEADER, ROWHEADER, and DATA.

Alias TABLE

TEXT

makes ODS TEXT output work like titles, footnotes, PROC titles, and BY lines. The text is written into multiple merged cells and Wrap Text is enabled.

Nasser_DRMCP
Lapis Lazuli | Level 10

hello

 

thanks for your quick respons but i did not manage to implement it;

I use the option FLOW but the text still contains a return carriage

thanks

Nasser

data_null__
Jade | Level 19

I suspect you used the DEFINE statement option FLOW.  You need ODS EXCEL OPTIONS(FLOW="TABLE') 

 

ODS Excel options (SHEET_NAME = "Base"
                   EMBEDDED_TITLES = "off"
                   FROZEN_HEADERS = "yes"
                   AUTOFILTER = "all"
                   FLOW = 'Table'
                   absolute_row_height='30'
                   ROW_HEIGHTS="0,20,0,0,0,0,0");

@Nasser_DRMCP wrote:

hello

 

thanks for your quick respons but i did not manage to implement it;

I use the option FLOW but the text still contains a return carriage

thanks

Nasser


 

Nasser_DRMCP
Lapis Lazuli | Level 10

thanks a lot

I get the attended result in excel by cliking on button "automatic retour cariage"

Why this button is turn on ?

thanks

Nasser_DRMCP
Lapis Lazuli | Level 10

Nasser_DRMCP_0-1670947191395.png

I wonder why this button is activated;

Nasser_DRMCP
Lapis Lazuli | Level 10

i would like to avoid return cariage

Nasser_DRMCP
Lapis Lazuli | Level 10

hello

my problem is that wrap text button is enabled by opening my excel file. i would like it to be disabled

thanks a lot in advance for your help

Nass

Nasser_DRMCP_0-1671009636397.png

Nasser_DRMCP_1-1671009654254.png

 

Ksharp
Super User
PROC REPORT DATA=TEST NOWD
    STYLE(header)=[background=CX9BC2E6 foreground=white]
    STYLE(column)=[cellwidth=3cm ]
 ;
    COLUMN
      col1 col2 col3;
define _all_/style={tagattr='wrap:no'};
RUN;

Ksharp_0-1671018054649.png

 

微信图片_20221214194158.png

Nasser_DRMCP
Lapis Lazuli | Level 10

thanks a lot for your quick respons

the "wrap text" button is disabled and the text has not return carriage

But I wonder why there is a return carriage inside the formul bar ?

Nasser_DRMCP_0-1671021947729.png

 

Nasser_DRMCP
Lapis Lazuli | Level 10

by copy/past the content of the excel sheet into ultra edit I can note that the text contains character return cariage; and I do't know why

Ksharp
Super User

That is because you used this style "cellwidth=3cm". if remove it ,you would not got return cariage .

 

PROC REPORT DATA=TEST NOWD
    STYLE(header)=[background=CX9BC2E6 foreground=white]

    STYLE(column)=[cellwidth=3cm ]  /*<-----  Remove it */
 ;
    COLUMN
      col1 col2 col3;
define _all_/style={tagattr='wrap:no'};
RUN;
Nasser_DRMCP
Lapis Lazuli | Level 10

thanks for your quick respons

by doing that, tthe result is just below. and I agree, the carriage return no longer appaers.

but the column is width.

Nasser_DRMCP_0-1671108838203.png

what I would le to get is that below 

Nasser_DRMCP_1-1671109036310.png

many thanks for your help

Ksharp
Super User

OK. Try this option "Absolute_Column_Width".

 

ODS LISTING CLOSE;
ODS EXCEL FILE="c:\temp\TEST_NASSER.xlsx" STYLE=HTMLBlue;
ODS Excel options (SHEET_NAME = "Base"
                   EMBEDDED_TITLES = "off"
                   FROZEN_HEADERS = "yes"
                   AUTOFILTER = "all" 
                   absolute_row_height='30'   Absolute_Column_Width="10,10,10"   /*<---Try this one*/
                   ROW_HEIGHTS="0,20,0,0,0,0,0");


PROC REPORT DATA=TEST NOWD
    STYLE(header)=[background=CX9BC2E6 foreground=white]

 ;
    COLUMN
      col1 col2 col3;
define _all_/style={tagattr='wrap:no' } ;
RUN;
ODS Excel CLOSE;
ODS LISTING;

Ksharp_0-1671192007589.png

 

Nasser_DRMCP
Lapis Lazuli | Level 10

hello Ksharp

it works very well as attended !

thanks for your efficiency

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