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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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