<?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: one file or more of union not there in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958794#M374189</link>
    <description>If you want to know which dataset is not exist, then check dictionary table as FreelanceReinh showed .</description>
    <pubDate>Mon, 10 Feb 2025 09:00:51 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2025-02-10T09:00:51Z</dc:date>
    <item>
      <title>one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958788#M374185</link>
      <description>&lt;P&gt;How can I intercept when a file is not there? And then the processing union continues. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table union_test as&lt;BR /&gt;&amp;nbsp; &amp;nbsp;select * from Test_A&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;union all &lt;BR /&gt;&amp;nbsp; &amp;nbsp;select * from Test_B&lt;BR /&gt;&amp;nbsp; &amp;nbsp; union all &lt;BR /&gt;&amp;nbsp; select * from Test_C;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 07:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958788#M374185</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2025-02-10T07:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958789#M374186</link>
      <description>&lt;P&gt;You could use SET statement to repalce UNION ALL of SQL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRONG&gt;options nodsnferr;&lt;/STRONG&gt;
data Test_A Test_B;
 set sashelp.class;
run;


&lt;STRONG&gt;data union_test;
 set  Test_A Test_B Test_C;
run;&lt;/STRONG&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Feb 2025 07:45:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958789#M374186</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-02-10T07:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958790#M374187</link>
      <description>&lt;P&gt;How can I intercept the file if it is not there?&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 08:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958790#M374187</guid>
      <dc:creator>Hoibai</dc:creator>
      <dc:date>2025-02-10T08:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958793#M374188</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/463573"&gt;@Hoibai&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you must use PROC SQL, check the existence of the datasets by querying DICTIONARY.TABLES:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint feedback;
select memname into :dsnames separated by ' union all select * from '
  from dictionary.tables
  where libname='WORK' &amp;amp; memname in ('TEST_A', 'TEST_B', 'TEST_C'); /* names in upper case! */
%if &amp;amp;sqlobs %then %do;
  create table union_test as
  select * from &amp;amp;dsnames;
%end;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The %IF condition (allowed in open code) prevents an error in the case that none of the datasets exists.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 08:54:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958793#M374188</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-02-10T08:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958794#M374189</link>
      <description>If you want to know which dataset is not exist, then check dictionary table as FreelanceReinh showed .</description>
      <pubDate>Mon, 10 Feb 2025 09:00:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958794#M374189</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-02-10T09:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: one file or more of union not there</title>
      <link>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958815#M374197</link>
      <description>&lt;P&gt;You can use the NODSNFERR setting to suppress errors when datasets referenced do not exist.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Will work if you just use normal SAS code to concatenate your datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test_a test_c;
  set sashelp.class;
run;

options nodsnferr;
data want ;
  set test_a test_b test_c;
run;
options dsnferr;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Feb 2025 15:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/one-file-or-more-of-union-not-there/m-p/958815#M374197</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-02-10T15:59:18Z</dc:date>
    </item>
  </channel>
</rss>

