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 (July 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 3 Jul 2008 13:05:30 -0700
Reply-To:     "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject:      Re: SAS -> XML problem
Comments: To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
In-Reply-To:  A<>
Content-Type: text/plain; charset="us-ascii"

Hi Ron,

Two things, first I'm pretty sure that your line: <typeact>" ">/typeact> was just a handwritten example for the email and really is not important here in this discussion. I'm sure you meant: <typeact>" "</typeact>

Secondly, there are two aspects to what XML content you have, one, the way the different engines from different products *write* the text file, and two, the way different products *read* the text file. i.e. you can manually edit the text file and you will find that IE and Excel just as two examples, will interpret all three of these as the same: <typeact Missing=" " /> <typeact></typeact> <typeact /> The SAS xml engine just happens to use the more formal robust first example when writing out the text file.

Other applications and software that *read* xml code may/maynot support all three (we would have to check the xml version specs...)

The example of: <typeact>" "<typeact> for both IE and Excel will load all three characters doublequote/space/doublequote. as the actual data.

Hope this is helpful.

Mark Terjeson Senior Programmer Analyst Investment Management & Research Russell Investments

Russell Investments Global Leaders in Multi-Manager Investing

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Fehd, Ronald J. (CDC/CCHIS/NCPHI) Sent: Thursday, July 03, 2008 12:31 PM To: SAS-L@LISTSERV.UGA.EDU Subject: SAS -> XML problem

I have a Concerned User who writes:

> Perhaps you know some SAS programmers who have dealt with this. > The following code is one way to produce XML from a SAS dataset: > > libname Library2 'c:\temp'; > > libname xmlTest xml "..\TestData.xml"; > > proc copy in = Library2 > out = xmlTest; > select TestData; > run; > > There's one difficulty with the output, however. > In the following sample, > the format for a record where data exists > is different from the format where there's a missing value. > I can't find the options or the controls to tell SAS > to output each item the same way > regardless of whether a value is missing. > > <?xml version="1.0" encoding="windows-1252" ?> > <TABLE> > <PROVTEST> > <clia_num>01D0098765</clia_num> > <region>99</region> > <state>GA</state> > <category>99</category> > <typeact Missing=" " /> > <termcd1>00</termcd1> > <currdt Missing=" " /> > Etc. > > We want to use the XML file to update the data on an SQL Server.

given the well-formed xml assignment:

> <category>99</category>

I think that the Q is: "Why is this happening?"

> <typeact Missing=" " />

rather than a complete open and close

> <typeact>" ">/typeact>

Anyone know enough xml and SAS to offer commentary?

Ronald J. Fehd, IT Spec HelpDesk Level 3: SAS

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