Date: Mon, 18 Aug 2008 15:42:04 -0600
Reply-To: Alan Churchill <savian001@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Alan Churchill <savian001@GMAIL.COM>
Subject: Re: XML help plzzz
In-Reply-To: <727b0162-60d5-462c-baa6-d41278a20b09@26g2000hsk.googlegroups.com>
Content-Type: text/plain; charset="us-ascii"
Read it in as normal and then simply write it out using the SAS XML libname
engine.
libname test xml 'c:\temp' ;
data test.MyTable ;
set sashelp.shoes; *replace this with your code.
run;
Alan
Alan Churchill
Savian
www.savian.net
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Sri
Sent: Monday, August 18, 2008 12:48 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: XML help plzzz
Hello All,
I'm trying to create an XML file from my SAS dataset, using PUT
statements.
My sample dataset is:
data my_xml_data;
input Region $2. +1 Student $5. +1 Location $3. +1 Score_week 2. +1
Score_month 2. +1 Amount_week 7.2 +1 Amount_month 7.2;
cards;
01 Tom RIC 19 66 986.00 1977.52
01 Tom BLA 17 59 1210.00 3048.01
02 Nancy FCH 21 82 1300.00 3126.56
02 Nancy HER 12 48 1129.00 2075.98
;
My goal is to create an XML file that arranges the above data in the
format as shown below:
Score Amount
Region 01
Student Tom
Location RIC
Week 19 986
Month 66 1977.52
Location BLA
Week 17 1210
Month 59 3048
Student Nancy
Location FCH
Week 21 1300
Month 82 3126.56
Location HER
Week 12 1129
Month 48 2075.98
I'm new to XML, any help in this matter is highly appreciated.
Regards
Sri