<?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: Using a do loop to load multiple data sets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345897#M79652</link>
    <description>&lt;P&gt;You'll need the full path names for that to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;filename SIPP_FILES ('somepath\l08puw1.dat' 'somepath\l08puw2.dat' 'somepath\l08puw3.dat');&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 30 Mar 2017 18:52:42 GMT</pubDate>
    <dc:creator>collinelliot</dc:creator>
    <dc:date>2017-03-30T18:52:42Z</dc:date>
    <item>
      <title>Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345867#M79645</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use a do loop to upload multiple data files that vary by a trailing integer (e.g. dataset1.dat, dataset2.dat, etc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using a macro, but have had issues. From the way the editor does not bold the data procedure it seems like it is not recognizing it as a command within the marco. Anyone have suggestions?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; SIPP1 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\...SIPP\l08puw1.dat"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt; SIPP2 &lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\...SIPP\l08puw2.dat"&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt; SIPP3 &lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\...SIPP\l08puw3.dat"&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;filename&lt;/FONT&gt; SIPP4 &lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\...SIPP\l08puw4.dat"&lt;/FONT&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &lt;STRONG&gt;&lt;I&gt;uploadSIPP&lt;/I&gt;&lt;/STRONG&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%local&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; i=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%to&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;4&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; data&lt;/FONT&gt;&amp;nbsp;SIPPRAW&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;INFILE SIPP&amp;amp;i PAD LRECL=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2341&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; INPUT&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; SSUSEQ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;- &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;5&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; SSUID $ &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;6&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;- &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;17&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SPANEL &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;18&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;- &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;21&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#333333" face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;&amp;nbsp;&amp;nbsp; FILLER &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2338&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;-&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;2340&lt;/FONT&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; uploadSIPP;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;uploadSIPP&lt;/I&gt;&lt;/STRONG&gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:28:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345867#M79645</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T18:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345872#M79646</link>
      <description>&lt;P&gt;You can use one filename that refers to multiple files. If they are all the same structure, and in your example it looks like they are, this would be much easier.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename all_files ('file1.txt' file2.txt' etc...);&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:34:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345872#M79646</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-30T18:34:56Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345875#M79648</link>
      <description>&lt;P&gt;That said, I wouldn't rely on the editor syntax highlighitng to tell you if it's correct code. Are you getting an error when you run what you? What are the issues?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:37:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345875#M79648</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-30T18:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345888#M79650</link>
      <description>&lt;P&gt;Your code worked fine for me. You'd have to show us your log for anyone to know what your problem is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345888#M79650</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-03-30T18:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345891#M79651</link>
      <description>&lt;P&gt;I had no idea that could be done. When I try however I am getting this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;filename SIPP_FILES ('l08puw1.dat' 'l08puw2.dat' 'l08puw3.dat');&lt;/P&gt;&lt;P&gt;ERROR: Invalid logical name.&lt;/P&gt;&lt;P&gt;ERROR: Error in the FILENAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a feeling I am missing a basic point.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:47:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345891#M79651</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T18:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345897#M79652</link>
      <description>&lt;P&gt;You'll need the full path names for that to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;filename SIPP_FILES ('somepath\l08puw1.dat' 'somepath\l08puw2.dat' 'somepath\l08puw3.dat');&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345897#M79652</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-30T18:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345905#M79655</link>
      <description>&lt;P&gt;Weird. Now it works for me too. I guess I got caught up in the editor labeling. I also rebooted SAS so maybe that helped.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the confirmation. I was driving myself crazy!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:58:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345905#M79655</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T18:58:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345907#M79656</link>
      <description>&lt;P&gt;Even though it appears the old code works, I am intriqued by the naming of multiple files, but am still getting an error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1047 filename SIPP_FILES ('C:\Users\...\Desktop\SIPP\l08puw1.dat'&lt;/P&gt;&lt;P&gt;1047! 'C:\Users\...\Desktop\SIPP\l08puw2.dat');&lt;/P&gt;&lt;P&gt;ERROR: Invalid logical name.&lt;/P&gt;&lt;P&gt;ERROR: Error in the FILENAME statement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 18:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345907#M79656</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T18:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345915#M79658</link>
      <description>&lt;P&gt;The error is saying that the path and or file is not valid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you replacing the actual path with "..." or is that your actual syntax?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345915#M79658</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-30T19:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345921#M79659</link>
      <description>&lt;P&gt;It appears SAS did not like the name SIPP_FILES. When I changed the name to SIPP_FIL the code worked. When I switched it back to SIPP_FILES it got angry again. Guess I should always remember to check the name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the tip by the way!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:16:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345921#M79659</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T19:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345923#M79660</link>
      <description>&lt;P&gt;Note that you can use wildcards, too, so you could just replace the # with "*" and really limit your typing. Just make sure you're not pulling in something you don't want.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:18:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345923#M79660</guid>
      <dc:creator>collinelliot</dc:creator>
      <dc:date>2017-03-30T19:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345937#M79663</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/136710"&gt;@hoops581&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;It appears SAS did not like the name SIPP_FILES. When I changed the name to SIPP_FIL the code worked. When I switched it back to SIPP_FILES it got angry again. Guess I should always remember to check the name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the tip by the way!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FILENAME and LIBNAME are both limited to 8 characters in the reference name so since&amp;nbsp;SIPP_FILES has 10 characters that is an error.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 19:36:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345937#M79663</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-30T19:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using a do loop to load multiple data sets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345965#M79677</link>
      <description>&lt;P&gt;Good to know! I thought it was perhaps something related to having "FILE" in the name. That will save me many errors in the future. Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2017 21:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Using-a-do-loop-to-load-multiple-data-sets/m-p/345965#M79677</guid>
      <dc:creator>hoops581</dc:creator>
      <dc:date>2017-03-30T21:06:45Z</dc:date>
    </item>
  </channel>
</rss>

