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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 593 views
  • 0 likes
  • 2 in conversation