LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 6 Oct 2005 10:06:19 -0400
Reply-To:     Susie Li <Susie.Li@TVGUIDE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Susie Li <Susie.Li@TVGUIDE.COM>
Subject:      Re: SAS 8.2 and XML UTF-8
Content-Type: text/plain

On the same topic, since I'm new to XML, and we are also receiving XML files from the web, I wonder if anyone on the list can tell me how SAS (I have v9) can easily read in such files.

Thanks.

Susie Li TV Guide 1211 Avenue of the Americas New York, NY 10036 Tel 212.852.7453 Email susie.li@tvguide.com

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Chang Chung Sent: Thursday, October 06, 2005 9:42 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS 8.2 and XML UTF-8

On Thu, 6 Oct 2005 08:56:25 +0200, magnusson tomas <tmagnusson@MEDISERVICE. CH> wrote:

>Hi all, > >I've been trying outputting a dataset with UTF-8 as > >libname outdata xml 'p:\sas\test\outdata.xml' ENCODING="UTF-8"; > >data outdata.shoes; > set sashelp.shoes; >run; > >My problem is that it seems to put en extra character-set control character in the beginning of the output file (in hex >FF FE FF FE ...) and the provider that receives the files means that it should begin only with FF FE ..... >[As text : >?<?xml version="1.0" encoding="utf-8" ?> >] (suppose this is not readable for some of you) > >Is it a workaround for this other than strip the output file of the first 4 bytes?

Hi, Tom,

On my sas 9.1.3 Service Pack 2 on winXP works fine. The following code generates clean xml doc without extra character-set character at all. Just reporting to you what happens with this specific set up. HTH.

Cheers, Chang

libname outdata xml 'd:\outdata.xml' ENCODING="UTF-8"; data outdata.shoes; set sashelp.shoes; run; libname outdata clear;

/* the content of d:\outdata.xml -- first several lines <?xml version="1.0" encoding="utf-8" ?> <TABLE> <SHOES> <Region> Africa </Region> <Product> Boot </Product> <Subsidiary> Addis Ababa </Subsidiary> <Stores> 12 </Stores> */


Back to: Top of message | Previous page | Main SAS-L page