ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I would like to bring to your notice a pecularity in SAS ODS when fetching data from Dataset to excel in Handeling of Special character "%" :

I tried:

data new;
input a$ ;
cards;
as
1%1g
1231
%%
qq
%
00
1%1g
aa
1%
ww
1%1
;

run;



ODS HTML FILE="C:\new.xls" ;
PROC PRINT DATA=new; RUN;
ODS HTML close;


But I see the observations: 2, 4 and 8 are not handeled properly.

the excel sheet has the below output

The SAS System

Obs a
1 as
2 11g
3 1231
4 %
5 qq
6 %
7 00
8 11g
9 aa
10 1%
11 ww
12 1%1

I hav used SAS 9.1.3
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
If you inspect the SAS-generated file (not using Excel), you will see that the data rows are generated correct and complete. The issue is with how Excel is interpreting those data rows and the imbedded "%" character under specific circumstances.

Investigate techniques for influencing how Excel is to interpret the SAS-generated file.

I found a related technical/conference paper at the SAS support http://support.sas.com/ website using the SEARCH facility:

Using ODS to Generate Excel Files
Chevell Parker
http://support.sas.com/rnd/base/ods/templateFAQ/Excel1.pdf


Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks Scott,
for sharing the info you had,

I now have the exact explanation for this, which is documented in the SAS Note below. This problem is fixed in SAS 9.2. and I was using 9.1

http://support.sas.com/kb/17/862.html

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 2 replies
  • 867 views
  • 0 likes
  • 2 in conversation