<?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: Import multiple XML files with &amp;quot;bad&amp;quot; names into one SAS dataset in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533248#M6162</link>
    <description>&lt;P&gt;I am also importing xml files, not csv.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Feb 2019 14:25:08 GMT</pubDate>
    <dc:creator>fordcr2</dc:creator>
    <dc:date>2019-02-06T14:25:08Z</dc:date>
    <item>
      <title>Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533235#M6159</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to import multiple text files into one SAS file from a server. I figured I needed to use a macro to do so, but the filenames are formatted like this:&amp;nbsp;test-20181002-170338-230. So what I need to do is import hundreds of these files names in this format but with different numbers (ex. test-xxxxxxxx-xxxxxx-xxx) all at once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on how I could do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:11:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533235#M6159</guid>
      <dc:creator>fordcr2</dc:creator>
      <dc:date>2019-02-06T14:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533242#M6160</link>
      <description>&lt;P&gt;There are several options.&amp;nbsp; Do a search on here and you will find lots of posts on the subject, "importing multiple csv files" is a good term to search for.&lt;/P&gt;
&lt;P&gt;One simple option: Get a list from os using pie, then call execute a macro call or code to import the file from a datastep.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533242#M6160</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-06T14:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533247#M6161</link>
      <description>&lt;P&gt;I've found some options for importing the files but my issue is with the filenames as SAS does not like files with -'s in them. Is there an additional macro I need to use to solve this?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:24:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533247#M6161</guid>
      <dc:creator>fordcr2</dc:creator>
      <dc:date>2019-02-06T14:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533248#M6162</link>
      <description>&lt;P&gt;I am also importing xml files, not csv.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533248#M6162</guid>
      <dc:creator>fordcr2</dc:creator>
      <dc:date>2019-02-06T14:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533254#M6163</link>
      <description>&lt;P&gt;SAS has no problems importing files with "-" in at all.&amp;nbsp; Just ran this fine:&lt;/P&gt;
&lt;PRE&gt;data want;
  length tmp $200;
  infile "&amp;amp;_sasws_./temp-2010101.txt";
  input tmp $;
run;&lt;/PRE&gt;
&lt;P&gt;No issues at all.&lt;/P&gt;
&lt;P&gt;"&lt;SPAN&gt;I am also importing xml files, not csv."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Irrelevant.&amp;nbsp; You are importing a text file, setup is exactly the same, just different call/engine used to read the data.&amp;nbsp; Its still both text files.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Feb 2019 14:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533254#M6163</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-06T14:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple XML files with "bad" names into one SAS dataset</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533318#M6165</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255164"&gt;@fordcr2&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've found some options for importing the files but my issue is with the filenames as SAS does not like files with -'s in them. Is there an additional macro I need to use to solve this?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Once you have string with the original name to read with you can modify that string to something SAS will accept for SAS dataset names. The example code below shows changing all of the dash to underscores which are valid in SAS dataset names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data example;
   x='test-20181002-170338-230';
   y=translate(x,'_','-');
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Feb 2019 16:07:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Import-multiple-XML-files-with-quot-bad-quot-names-into-one-SAS/m-p/533318#M6165</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-02-06T16:07:37Z</dc:date>
    </item>
  </channel>
</rss>

