BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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;
1 ACCEPTED SOLUTION

Accepted Solutions
SuryaKiran
Meteorite | Level 14

Just as if you were concatenating SAS Datasets. 

 

data want;
set
XMLData.TestAC XMLData1.TestSiteDet;
run;
Thanks,
Suryakiran

View solution in original post

2 REPLIES 2
SuryaKiran
Meteorite | Level 14

Just as if you were concatenating SAS Datasets. 

 

data want;
set
XMLData.TestAC XMLData1.TestSiteDet;
run;
Thanks,
Suryakiran
Reeza
Super User

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;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2080 views
  • 2 likes
  • 3 in conversation