<?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: SQL Joins and concatenation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534614#M146720</link>
    <description>OUTER UNION simply concatenates query results (similar to how the SET works in the data step).  CORR tells SQL to match up column names (without CORR, it matches up columns one-by-one without looking at the names).&lt;BR /&gt;&lt;BR /&gt;This is answered in detail here: &lt;A href="https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n0vo2lglyrnexwn14emi8m0jqvrj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n0vo2lglyrnexwn14emi8m0jqvrj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;</description>
    <pubDate>Mon, 11 Feb 2019 20:57:56 GMT</pubDate>
    <dc:creator>snoopy369</dc:creator>
    <dc:date>2019-02-11T20:57:56Z</dc:date>
    <item>
      <title>SQL Joins and concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534561#M146698</link>
      <description>&lt;P&gt;DATA CVA1819Q2;&lt;BR /&gt;SET CVA.FY1819Q2_VOLUME&lt;BR /&gt;CVA.FY1819Q2_MC (IN=MC);&lt;BR /&gt;&lt;BR /&gt;/* ADD LEADING 0 FOR PROCEDURES 1-9 IN ORDER TO SORT PROPERLY */&lt;BR /&gt;IF SUBSTR(PROCEDURE,2,1)='.' THEN PROCEDURE = '0'||PROCEDURE;&lt;/P&gt;&lt;P&gt;IF MC=1 THEN PROCEDURE='11. Mitral Clip';&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;Can someone advise if the set statement is concatenating the 2 data sets ? also what is placing the in=mc marker doing in the set statement?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;For the proc sql code below: what is outer union corr doing ?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC SQL;&lt;BR /&gt;CREATE VIEW CVA_MS_LHIN_VIEW AS&lt;BR /&gt;SELECT DISTINCT&lt;BR /&gt;WAITLISTENTRYID,&lt;BR /&gt;PROCEDURE,&lt;BR /&gt;PATIENTLHINNAME,&lt;BR /&gt;'LHIN' AS SORTORDER&lt;BR /&gt;FROM CVA1819Q2(WHERE=(MISSING(PATIENTLHINNAME)=0))&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;OUTER UNION CORR&lt;/FONT&gt;&lt;BR /&gt;SELECT DISTINCT&lt;BR /&gt;WAITLISTENTRYID,&lt;BR /&gt;PROCEDURE,&lt;BR /&gt;'Ontario' AS PATIENTLHINNAME,&lt;BR /&gt;'PROV' AS SORTORDER&lt;BR /&gt;FROM CVA1819Q2(WHERE=(MISSING(PATIENTLHINNAME)=0));&lt;BR /&gt;QUIT;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Feb 2019 18:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534561#M146698</guid>
      <dc:creator>Ranjeeta</dc:creator>
      <dc:date>2019-02-11T18:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Joins and concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534589#M146708</link>
      <description>SET concatenates or appends data set. IN=MC allows you to identify which records come from which data set in case you want to exercise conditional logic. You can see it used later, to set the procedure name for that file. &lt;BR /&gt;&lt;BR /&gt;I'll leave the SQL explanation for someone else.</description>
      <pubDate>Mon, 11 Feb 2019 19:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534589#M146708</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-02-11T19:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Joins and concatenation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534614#M146720</link>
      <description>OUTER UNION simply concatenates query results (similar to how the SET works in the data step).  CORR tells SQL to match up column names (without CORR, it matches up columns one-by-one without looking at the names).&lt;BR /&gt;&lt;BR /&gt;This is answered in detail here: &lt;A href="https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n0vo2lglyrnexwn14emi8m0jqvrj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;https://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=n0vo2lglyrnexwn14emi8m0jqvrj.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en&lt;/A&gt;</description>
      <pubDate>Mon, 11 Feb 2019 20:57:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SQL-Joins-and-concatenation/m-p/534614#M146720</guid>
      <dc:creator>snoopy369</dc:creator>
      <dc:date>2019-02-11T20:57:56Z</dc:date>
    </item>
  </channel>
</rss>

