All,
If I have 2 SAS datasets that are stored as XML files, how can I concatenate them ?
libname XMLData xmlv2 '/data/Test.xml';
data Work.TestACMod;
set Work.TestAC;
format ReadTime datetime.;
run;
data XMLData.TestAC;
Set Work.TestACMod;
run;
libname XMLData1 xmlv2 '/data/Test1.xml';
data Work.TestSiteDet;
set Work.Sit;
format CoDate datetime.;
run;
data XMLData1.TestSiteDet;
set Work.TestSiteDet;
run;
Just as if you were concatenating SAS Datasets.
data want;
setXMLData.TestAC
XMLData1.TestSiteDet;
run;
Just as if you were concatenating SAS Datasets.
data want;
setXMLData.TestAC
XMLData1.TestSiteDet;
run;
I think you'll need a SQL join. You say concatenate but based on my knowledge of XML it looks like it was parsed to multiple tables and you want to combine them again. We can't tell you how to join it without more information on the data, specifically the logic to link it.
If I'm incorrect, one of the other users solution will work for you.
@UdayGuntupalli wrote:
All,
If I have 2 SAS datasets that are stored as XML files, how can I concatenate them ?
libname XMLData xmlv2 '/data/Test.xml'; data Work.TestACMod; set Work.TestAC; format ReadTime datetime.; run; data XMLData.TestAC; Set Work.TestACMod; run; libname XMLData1 xmlv2 '/data/Test1.xml'; data Work.TestSiteDet; set Work.Sit; format CoDate datetime.; run; data XMLData1.TestSiteDet; set Work.TestSiteDet; run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.