When building a listing report, ODS is causing text variables to wrap where some spaces are. I used the TAGATTR to remove the wrapping, but then the spaces disappear in some spots in the text variables giving the appearance of names that are run together. They do not appear this way in the dataset. Suggestions as to a workaround?
ods excel file="aaa.xlsx" options(SHEET_NAME='Recap' autofilter = 'All' embedded_titles='Yes'
absolute_column_width='20,8,30,30,15,14,14,14,14,14,14,14,14,14') style = htmlblue;
Title "YTD Recap for the Period Ending &Rpt_AS_OF";
Title2 "Summary Report as of &Rpt_Date";
proc report data = recap2 nowd contents = ' ' ;
column name
code
market
area
PD_CM_PTS
CA_CM_PTS
FIN
S1_CM_PTS
S2_CM_PTS
CR NARR
COV
NUM_POL
ZZZ;
define name / "Name" style={tagattr='wrap:No'};
define code / "Code" ;
define Market / "Market" format = $mkt. order = data style={tagattr='wrap:No'} ;
define area / "Area" format = $area. order = data style={tagattr='wrap:No'} ;
define CR/ 'CR' format = f8.2 ;
define CA_CM_PTS / 'CC ' format = f8.2 ;
define PD_CM_PTS / 'PD' format = f8.2 ;
define S1_CM_PTS / 'S1' format = f8.2 ;
define S2_CM_PTS / 'S2' format = f8.2 ;
define FIN / 'Fin.' format = f8.2 ;
define NARR / 'Narr.' format = f8.2 ;
define NUM_COV / 'Cov' format = f8.2 ;
define NUM_POL / 'Pol' format = f8.2 ;
define ZZZ /'Overall' format = f8.3 ;
run;
ODS excel CLOSE;
NOTE: There were 158 observations read from the data set WORK.RECAP2.
NOTE: PROCEDURE REPORT used (Total process time):
real time 0.59 seconds
cpu time 0.56 seconds
NOTE: Writing EXCEL file: \aaa.xlsx
No sure if it work, Try another style.
style={tagattr='wrap:No' asis=on } ;
No sure if it work, Try another style.
style={tagattr='wrap:No' asis=on } ;
That worked! I haven't used asis for quite some time...
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!
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.