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.TestACXMLData1.TestSiteDet;
run;
Just as if you were concatenating SAS Datasets.
data want;
setXMLData.TestACXMLData1.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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.