BookmarkSubscribeRSS Feed
Malathi13
Obsidian | Level 7

Hi,

I have 100,000 xml files that I want to import into SAS. Is this possible to do so? I might have to convert the xml files to sas datasets or excel format. I tried doing it but I was not successful in converting xml files to sas datasets.

 

Can someone help me in converting xml file to sas datasets/ excel files? Also, I want to know if I can import more than 100,000 individual xml files into sas.

 

Thank you

M

3 REPLIES 3
Reeza
Super User

Figure out how to do one first. Then it's easy to automate it for the remaining. 

 

Do you have working code for one file?

 


@Malathi13 wrote:

Hi,

I have 100,000 xml files that I want to import into SAS. Is this possible to do so? I might have to convert the xml files to sas datasets or excel format. I tried doing it but I was not successful in converting xml files to sas datasets.

 

Can someone help me in converting xml file to sas datasets/ excel files? Also, I want to know if I can import more than 100,000 individual xml files into sas.

 

Thank you

M


 

ChrisBrooks
Ammonite | Level 13

To import XML into SAS a simple Google search gives lots of results - the first three being

 

http://support.sas.com/resources/papers/proceedings12/253-2012.pdf

 

https://communities.sas.com/t5/Base-SAS-Programming/How-can-I-import-XML-file-into-SAS/td-p/283948

 

http://support.sas.com/resources/papers/proceedings17/1318-2017.pdf

 

The bottom line is - much depends on the structure of your XML.....

ChrisNZ
Tourmaline | Level 20

2 steps:

1- As mentioned, figure out the logic to read one file

2- You can then read all the files in one fell swoop once the logic is know; it will be much faster than 100,000 different steps. Look at the FILEVAR= option. 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 446 views
  • 2 likes
  • 4 in conversation