<?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 all in data step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/835256#M330223</link>
    <description>These are not three tables, it's one table with different summaries according to your posted code. Show the code for the three tables please.  I suspect this could be simplified into 2 queries but need to see the full process. &lt;BR /&gt;&lt;BR /&gt;DISTINCT isn't one that's great in SAS unless you have sorted data already, which may still be doable in a single data step. &lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 26 Sep 2022 18:56:52 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-09-26T18:56:52Z</dc:date>
    <item>
      <title>union all in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/589701#M168706</link>
      <description>&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE TABLE SL_1 AS&lt;BR /&gt;SELECT distinct A,AEC,'Patients ' AS VARIABLE, 1 AS GRP, COUNT(DISTINCT SUBJID) AS CNT&lt;BR /&gt;FROM A(WHERE=(FL='Y')) GROUP BY AEC&lt;BR /&gt;UNION ALL&lt;BR /&gt;SELECT distinct A,AEC,'Patients 2' AS VARIABLE, 2 AS GRP, COUNT(DISTINCT SUBJID) AS CNT&lt;BR /&gt;FROM A(WHERE=(FL='Y' AND FFL='N')) GROUP BY AEC&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to write above code in Data step&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/589701#M168706</guid>
      <dc:creator>Vijay77</dc:creator>
      <dc:date>2019-09-18T15:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: union all in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/589710#M168708</link>
      <description>&lt;P&gt;In general you wouldn't combine those types of calculations with the step that combines the datasets into one data step.&lt;/P&gt;
&lt;P&gt;To combine two datasets (aka UNION) just use the SET statement.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have1 have2;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/589710#M168708</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-09-18T15:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: union all in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/835249#M330221</link>
      <description>&lt;P&gt;What if I have three tables that want to union?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2022 18:16:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/835249#M330221</guid>
      <dc:creator>yliu1234</dc:creator>
      <dc:date>2022-09-26T18:16:51Z</dc:date>
    </item>
    <item>
      <title>Re: union all in data step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/835256#M330223</link>
      <description>These are not three tables, it's one table with different summaries according to your posted code. Show the code for the three tables please.  I suspect this could be simplified into 2 queries but need to see the full process. &lt;BR /&gt;&lt;BR /&gt;DISTINCT isn't one that's great in SAS unless you have sorted data already, which may still be doable in a single data step. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Sep 2022 18:56:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/union-all-in-data-step/m-p/835256#M330223</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-26T18:56:52Z</dc:date>
    </item>
  </channel>
</rss>

