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

I came across two issues when using ODS EXCEL with PROC ODSTEXT

1) why absolute_column_width doesn't apply in the below cases.

2) Long text in Proc odstext is not displayed  properly.

    When I tested text with length ~143 is displayed without warping, but longer text is being hidden.

 

ods excel file="test1.xlsx" 
options(absolute_column_width="100" ) style=Excel;
ods text="SAS was developed at North Carolina State University";
ods text="Wikipedia: SAS (previously 'Statistical Analysis System') is a software suite developed by SAS Institute for advanced analytics, multivariate analyses, business intelligence, data management, and predictive analytics.";
ods excel close;


ods excel file="test2.xlsx" 
options(absolute_column_width="100" ) style=Excel;
proc odstext;
p "SAS was developed at North Carolina State University";
p "Wikipedia: SAS (previously 'Statistical Analysis System') is a software suite developed by SAS Institute for advanced analytics, multivariate analyses, business intelligence, data management, and predictive analytics.";
run;
ods excel close;

image.png

 

 

Thanks,
Suryakiran
1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

Using width and tagattr= (merge cells) can better control the the text flow. 

 style={width=3in tagattr='mergeacross:5'}

 

ods excel file="test2.xlsx"
style=Excel;
proc odstext;
p "SAS was developed at North Carolina State University";
p "Wikipedia: SAS (previously 'Statistical Analysis System') is a software suite developed by SAS Institute for advanced analytics, multivariate analyses, business intelligence, data management, and predictive analytics." / style={width=3in tagattr='mergeacross:5'};
run;
ods excel close;

The ABSOLUTE_COLUMN_WIDTH= option is for the columns within the table. The TEXT= option is simply floating text which is a good use of PROC ODSTEXT.

 

Thanks,
Suryakiran

View solution in original post

3 REPLIES 3
SuzanneDorinski
Lapis Lazuli | Level 10

I don't know why this trick works, but it does.  Set width=1000% for the really long text.

 

%let path=/folders/myfolders/ODS Excel examples;

ods excel file="&path/test2.xlsx" style=Excel;

proc odstext;
	p "SAS was developed at North Carolina State University";
	p "Wikipedia: SAS (previously 'Statistical Analysis System') is a software suite developed by SAS Institute for advanced analytics, multivariate analyses, business intelligence, data management, and predictive analytics." 
		/ style={width=1000%};
run;

ods excel close;

The screen shot below shows what test2.xlsx looks like for me.

 

Set width=1000% on really long text in PROC ODSTEXT to force it to displaySet width=1000% on really long text in PROC ODSTEXT to force it to display

 

SuryaKiran
Meteorite | Level 14

This is weird, I will open SAS Technical Support track and see if they come up with something. 

Thanks,
Suryakiran
SuryaKiran
Meteorite | Level 14

Using width and tagattr= (merge cells) can better control the the text flow. 

 style={width=3in tagattr='mergeacross:5'}

 

ods excel file="test2.xlsx"
style=Excel;
proc odstext;
p "SAS was developed at North Carolina State University";
p "Wikipedia: SAS (previously 'Statistical Analysis System') is a software suite developed by SAS Institute for advanced analytics, multivariate analyses, business intelligence, data management, and predictive analytics." / style={width=3in tagattr='mergeacross:5'};
run;
ods excel close;

The ABSOLUTE_COLUMN_WIDTH= option is for the columns within the table. The TEXT= option is simply floating text which is a good use of PROC ODSTEXT.

 

Thanks,
Suryakiran

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 16648 views
  • 3 likes
  • 2 in conversation