<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Reading Multiple XML files into SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527878#M143999</link>
    <description>Hi:&lt;BR /&gt;  Here is a paper that explains the basics of Macro Processing: &lt;A href="https://support.sas.com/resources/papers/proceedings13/120-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/120-2013.pdf&lt;/A&gt;. It does not show using a Macro %DO loop, but once you get the basics out of the way, you can find examples on the forums of using CALL EXECUTE or a %DO loop to repeat a macro invocation multiple times.&lt;BR /&gt;Cynthia</description>
    <pubDate>Wed, 16 Jan 2019 22:31:18 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2019-01-16T22:31:18Z</dc:date>
    <item>
      <title>Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527856#M143982</link>
      <description>I have hundreds of XML files (all with same structure) that I want to read/write in SAS.&lt;BR /&gt;&lt;BR /&gt;What is the most efficient way? I was thinking of adding in loops that iterates through the number of XML files and stops once all files are read. Can this be done?&lt;BR /&gt;&lt;BR /&gt;Your feedback will be greatly appreciated.&lt;BR /&gt;Thank You.</description>
      <pubDate>Wed, 16 Jan 2019 21:43:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527856#M143982</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-16T21:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527858#M143983</link>
      <description>&lt;P&gt;Do you want to read the files into separate SAS data sets or into a single data set since they all have the same structure?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 21:46:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527858#M143983</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2019-01-16T21:46:45Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527860#M143984</link>
      <description>I want them all to be read into separate SAS datasets.</description>
      <pubDate>Wed, 16 Jan 2019 21:51:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527860#M143984</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-16T21:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527861#M143985</link>
      <description>Then it's a three step process. &lt;BR /&gt;1. Get a list of all files. &lt;BR /&gt;2.Write a program to read one file&lt;BR /&gt;3. Wrap it in a macro to read all files&lt;BR /&gt;&lt;BR /&gt;If you show how you're reading one file, generalzing the other two is relatively easy. Do you know how to read one file?</description>
      <pubDate>Wed, 16 Jan 2019 21:52:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527861#M143985</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T21:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527864#M143988</link>
      <description>I do not, also where will the macros need to be created?&lt;BR /&gt;&lt;BR /&gt;Apologies for the ignorance... SAS is brand new to me.&lt;BR /&gt;Thank You in advance.</description>
      <pubDate>Wed, 16 Jan 2019 21:59:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527864#M143988</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-16T21:59:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527866#M143989</link>
      <description>Maybe start there then, figure out how to read the file first. Then worry about how to do it for more than one. Macro's are programs, so you can store it wherever you're storing other programs.</description>
      <pubDate>Wed, 16 Jan 2019 22:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527866#M143989</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T22:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527875#M143996</link>
      <description>&lt;P&gt;Ok, I was able to code for one XML and get it to read successfully.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the next step? I am having a little tough time understanding. Am I just going to run the same code/ change file path 100 times?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please suggest on how to move forward.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527875#M143996</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-16T22:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527876#M143997</link>
      <description>&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Turning%20a%20program%20into%20a%20macro.md&lt;/A&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:27:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527876#M143997</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T22:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527877#M143998</link>
      <description>Example of importing all Excel Files at once:&lt;BR /&gt;&lt;A href="https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type" target="_blank"&gt;https://github.com/statgeek/SAS-Tutorials/blob/master/Import_all_files_one_type&lt;/A&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527877#M143998</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T22:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527878#M143999</link>
      <description>Hi:&lt;BR /&gt;  Here is a paper that explains the basics of Macro Processing: &lt;A href="https://support.sas.com/resources/papers/proceedings13/120-2013.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings13/120-2013.pdf&lt;/A&gt;. It does not show using a Macro %DO loop, but once you get the basics out of the way, you can find examples on the forums of using CALL EXECUTE or a %DO loop to repeat a macro invocation multiple times.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 16 Jan 2019 22:31:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527878#M143999</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-01-16T22:31:18Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527879#M144000</link>
      <description>But the data is XML, not excel. Will the macro be created after the XML is generated into excel file?&lt;BR /&gt;&lt;BR /&gt;Thanks for sharing Reeza.</description>
      <pubDate>Wed, 16 Jan 2019 22:33:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527879#M144000</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-16T22:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527880#M144001</link>
      <description>THose are examples of what you're trying to do, not the solution to your question. You can use it as an example of how to build your processes. Try walking through the tutorial, but if you have no SAS experience it may be kinda hard for you. &lt;BR /&gt;&lt;BR /&gt;UCLA also has a good SAS Tutorial on macros.</description>
      <pubDate>Wed, 16 Jan 2019 22:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/527880#M144001</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-16T22:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528085#M144076</link>
      <description>&lt;P&gt;Here is the code I used to read one xml file.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions on how to continue adding other XMLs?&lt;/P&gt;&lt;P&gt;A loop?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename test1 url '.xml file path';&lt;BR /&gt;libname&amp;nbsp; test1 XML xml;&lt;/P&gt;&lt;P&gt;proc copy in=test out=work;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc print;&lt;BR /&gt;run&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528085#M144076</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-17T16:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528087#M144078</link>
      <description>Ok, next step, do you have a list of all the files you need to read in to a data set? Is there a systematic naming system to your xml files?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:27:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528087#M144078</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-17T16:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528089#M144079</link>
      <description>&lt;P&gt;Yes I have all the files.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the xml files are systematic. The URLs only change slightly based off the issue type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ex: &lt;A href="http://www.mysite.com/xml/testxml.xml&amp;nbsp;" target="_blank"&gt;http://www.mysite.com/xml/testxml.xml&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jan 2019 16:33:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528089#M144079</guid>
      <dc:creator>msalam92</dc:creator>
      <dc:date>2019-01-17T16:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: Reading Multiple XML files into SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528090#M144080</link>
      <description>So what's the pattern, it's something that can easily be coded? Or you have the file names in a data step? If so, then you can look at that macro tutorial I included in my first answer and you can convert that program above to a macro and import all the files using call execute. &lt;BR /&gt;&lt;BR /&gt;Here's another good reference.&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/seminars/sas-macros-introduction/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;If you're having issues, post the full code you're using and the log to help with debugging. &lt;BR /&gt;&lt;BR /&gt;When programming macros, I also recommend turning on the debug options:&lt;BR /&gt;&lt;BR /&gt;options mprint symbolgen;</description>
      <pubDate>Thu, 17 Jan 2019 16:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-Multiple-XML-files-into-SAS/m-p/528090#M144080</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-01-17T16:45:24Z</dc:date>
    </item>
  </channel>
</rss>

