<?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: Union with Where clause on each dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680356#M205588</link>
    <description>It's not working as  I don't see any records in the output.&lt;BR /&gt;</description>
    <pubDate>Mon, 31 Aug 2020 02:55:51 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2020-08-31T02:55:51Z</dc:date>
    <item>
      <title>Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680344#M205577</link>
      <description>&lt;P&gt;I'm trying to Union the three datasets and in the final target dataset,I want to display all the records where REPORTING_DT variable values are not missing.It's a numeric variable and it has both missing and non missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I tried the code below, I could see no record is being created in the ouput.I did tried with 'Where REPORTING_DT&amp;nbsp; &amp;lt;&amp;gt; .' but still it's not producing any rows in the Output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Code which I used is,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
   create view work.TMP_Final_Output as
      select
      Have1.UNIT,
      Have1.REPORTING_CAUSE,
      Have1.REPORTING_DT      
   from
      Have1
   where
      REPORTING_DT NOT IS MISSING 
   union all  
   select
      Have2.UNIT,
      Have2.REPORTING_CAUSE,
      Have2.REPORTING_DT
         from
      Have2
   where
      REPORTING_DT NOT IS MISSING 
   union all  
   select
      Have3.UNIT,
      Have3.REPORTING_CAUSE,
      Have3.REPORTING_DT
      from
      Have3
   where
      REPORTING_DT NOT IS MISSING ;
quit;
      &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:07:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680344#M205577</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-08-31T02:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680345#M205578</link>
      <description>&lt;P&gt;Try this:&amp;nbsp;REPORTING_DT IS NOT MISSING&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:10:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680345#M205578</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-08-31T02:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680350#M205583</link>
      <description>&lt;P&gt;But this works...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
set sashelp.class;
where age =12;
run;

data b;
set sashelp.class;
where age =13;
run;

data c;
set sashelp.class;
where age =14;
run;

proc sql;
create view d as
select name from a where name not is missing
union all
select name from b where name not is missing
union all
select name from c where name not is missing;
select * from d;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680350#M205583</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-08-31T02:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680351#M205584</link>
      <description>&lt;P&gt;How did you check that your view returns no rows?&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680351#M205584</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-08-31T02:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680355#M205587</link>
      <description>I used create table statement to check the observation.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:51:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680355#M205587</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-08-31T02:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680356#M205588</link>
      <description>It's not working as  I don't see any records in the output.&lt;BR /&gt;</description>
      <pubDate>Mon, 31 Aug 2020 02:55:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680356#M205588</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-08-31T02:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680359#M205591</link>
      <description>&lt;P&gt;It may be that you tried to create a table AND a view with the same name? SAS doesn't allow that.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Aug 2020 03:08:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680359#M205591</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-08-31T03:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: Union with Where clause on each dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680367#M205598</link>
      <description>&lt;P&gt;You only create a view. A view does not do anything before it is used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that was only part of your code, then please:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;post usable example data for have1, have2, have3 (dara steps with datalines&lt;/LI&gt;
&lt;LI&gt;and your whole code that led to the "zero" result.&lt;/LI&gt;
&lt;LI&gt;and the log from that code&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Mon, 31 Aug 2020 05:34:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Union-with-Where-clause-on-each-dataset/m-p/680367#M205598</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-08-31T05:34:29Z</dc:date>
    </item>
  </channel>
</rss>

