how to remove space in the output when character variable is blank using ODS EXCEL? I have provided the below sample code and attached excel output file for your quick reference. Kindly note that formula used in "Column C" from test1.xslx file shows that "siteid" has single space inserted but I want to remove this. I am looking for a solution using ODS EXCEL in SAS EG 8.2.
data have ;
length SITEID $5 SUBJID $20 ;
infile cards dsd truncover ;
input siteid subjid ;
cards;
,102-002-001
,102-008-002
,102-008-008
,102-02-002
;
run;
ods excel file="c:\temp\test1.xlsx" ;
proc print data=have noobs label;
run;
ods excel close ;
Hi, Thanks for your reply!
In my organization, SAS EG 8.2 is installed and SAS EG 7.1 is going to retired shortly and I need to compare the previous output generated in SAS EG 7.1 and current output generated in SAS EG 8.2 for reconciliation report and this extra blank in SAS EG 8.2 is troubling to reconcile the output as it won't match.
Here is the below snapshot of length of "siteid" from both SAS EG 8.2 and SAS EG 7.1 which shows that SAS EG 8.2 is inserting blank value for character variable however it's not in SAS EG 7.1. Please help.
SAS EG 8.2 output length:
SAS EG 7.1 output length:
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.