ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
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-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Save $200 when you sign up by March 14!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 17427 views
  • 3 likes
  • 2 in conversation