<?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: Merging files using &amp;quot;Set&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485259#M126047</link>
    <description>Thanks, this worked and basically answered what I was looking for.</description>
    <pubDate>Wed, 08 Aug 2018 19:37:08 GMT</pubDate>
    <dc:creator>Leon27607</dc:creator>
    <dc:date>2018-08-08T19:37:08Z</dc:date>
    <item>
      <title>Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485247#M126043</link>
      <description>&lt;P&gt;So this is a general question about how SAS works. Basically if I am trying to stack a bunch of files together but there are some that are missing why does SAS throw an error and not proceed with the command?&lt;BR /&gt;For example&lt;BR /&gt;&lt;BR /&gt;data CombinedA;&lt;/P&gt;
&lt;P&gt;set A1-A900;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's say you were missing some files in there like... A89, A401, A589, A623, etc...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS will throw an error saying those files don't exist but the "CombinedA" file also does not get created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there a way to bypass this issue so that SAS will still stack all existing files together? I understand that yes I could just type in ranges and skip over the missing files but that can become tedious.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 18:48:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485247#M126043</guid>
      <dc:creator>Leon27607</dc:creator>
      <dc:date>2018-08-08T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485248#M126044</link>
      <description>&lt;P&gt;If all the data sets begin with the letter A, then you could use&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data combinedA;
    set a:;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But this may include other data sets that begin with the letter a that you don't want ... but since you gave us no additional information, that's all we can say at this time.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 18:52:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485248#M126044</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T18:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485249#M126045</link>
      <description>&lt;P&gt;Tr&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options nodsnferr;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2018 19:01:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485249#M126045</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-08T19:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485256#M126046</link>
      <description>Your method would definitely create some issues, but basically if you need additional information...(I didn't think it would be needed because my question seems pretty simple). I was basically running proc mixed, generating residuals for each variable, and testing for normality using the ODS output "TestsForNormality." Since I have ~800 variables/simple models to run I wanted to stack these tables all together. The problem I ran into was... some of these didn't exist because there was a lack of variation. Hence why I had this question.&lt;BR /&gt;&lt;BR /&gt;I tried to stack 800+ files together, had errors thrown saying some files were missing, SAS wouldn't generate the table with them all stacked together.</description>
      <pubDate>Wed, 08 Aug 2018 19:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485256#M126046</guid>
      <dc:creator>Leon27607</dc:creator>
      <dc:date>2018-08-08T19:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485259#M126047</link>
      <description>Thanks, this worked and basically answered what I was looking for.</description>
      <pubDate>Wed, 08 Aug 2018 19:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485259#M126047</guid>
      <dc:creator>Leon27607</dc:creator>
      <dc:date>2018-08-08T19:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485281#M126054</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9021"&gt;@Leon27607&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Your method would definitely create some issues, but basically if you need additional information...(I didn't think it would be needed because my question seems pretty simple). I was basically running proc mixed, generating residuals for each variable, and testing for normality using the ODS output "TestsForNormality." Since I have ~800 variables/simple models to run I wanted to stack these tables all together. The problem I ran into was... some of these didn't exist because there was a lack of variation. Hence why I had this question.&lt;BR /&gt;&lt;BR /&gt;I tried to stack 800+ files together, had errors thrown saying some files were missing, SAS wouldn't generate the table with them all stacked together.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But it does work if the data set names all have a unique prefix, such as MIXEDOUT1, MIXEDOUT2, MIXEDOUT9,&amp;nbsp;&lt;EM&gt;etc&lt;/EM&gt;. This is something you can control when you create the data sets. Then there are no issues with pulling in unwanted data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The only reason I brought up the problem with using data set names that begin with A was because that was the example you gave. I can't generalize to other examples without you providing additional information.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 20:26:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485281#M126054</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-08-08T20:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Merging files using "Set"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485307#M126065</link>
      <description>&lt;P&gt;You can do a test to see if the dataset exists and conditionally execute based on the result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One advantage to this over the other methods suggested is that you could explicitly report which data sets are missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But the other answers seem easier if this is not a concern.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/kb/24/670.html" target="_blank"&gt;http://support.sas.com/kb/24/670.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;%macro checkds(dsn);
   %if %sysfunc(exist(&amp;amp;dsn)) %then %do;
      proc print data = &amp;amp;dsn;
      run;
   %end;
   %else %do;
      data _null_;
         file print;
         put #3 @10 "Data set &amp;amp;dsn. does not exist";
      run;
   %end;
%mend checkds;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 23:19:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merging-files-using-quot-Set-quot/m-p/485307#M126065</guid>
      <dc:creator>Kow</dc:creator>
      <dc:date>2018-08-08T23:19:52Z</dc:date>
    </item>
  </channel>
</rss>

