<?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: proc sql : when key value is missing ! in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292045#M59925</link>
    <description>I have got one solution, I manually entered 0 wherever the key value was missing and then did left join as follows&lt;BR /&gt;proc sql;&lt;BR /&gt;create table base_3 as&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM A&lt;BR /&gt;LEFT JOIN B&lt;BR /&gt;ON A.AID= B.BID ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;Its working... However, if there is a better way.. advise is welcome !</description>
    <pubDate>Wed, 17 Aug 2016 02:20:01 GMT</pubDate>
    <dc:creator>deega</dc:creator>
    <dc:date>2016-08-17T02:20:01Z</dc:date>
    <item>
      <title>proc sql : when key value is missing !</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292041#M59924</link>
      <description>&lt;P&gt;I wrote the following code :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table new as&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM A,B&lt;BR /&gt;where A.AID= B.BID ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My output is almost as desired except the ones with missing values.&lt;BR /&gt;There are few observations in A where AID is missing and in final output&lt;BR /&gt;instead of getting the set of observations as it is, I am getting it repeated&lt;BR /&gt;n number of times. Could anybody please tell me the reason for the same.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 01:57:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292041#M59924</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-08-17T01:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : when key value is missing !</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292045#M59925</link>
      <description>I have got one solution, I manually entered 0 wherever the key value was missing and then did left join as follows&lt;BR /&gt;proc sql;&lt;BR /&gt;create table base_3 as&lt;BR /&gt;SELECT *&lt;BR /&gt;FROM A&lt;BR /&gt;LEFT JOIN B&lt;BR /&gt;ON A.AID= B.BID ;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;Its working... However, if there is a better way.. advise is welcome !</description>
      <pubDate>Wed, 17 Aug 2016 02:20:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292045#M59925</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-08-17T02:20:01Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : when key value is missing !</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292048#M59926</link>
      <description>&lt;P&gt;Instead of entering zeros by hand, you could do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table base_3 as
SELECT *
FROM A
LEFT JOIN B
ON coalesce(A.AID,0)= B.BID ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(untested)&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 02:27:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292048#M59926</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-08-17T02:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : when key value is missing !</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292049#M59927</link>
      <description>Tested, its working ! Thanks !</description>
      <pubDate>Wed, 17 Aug 2016 02:33:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292049#M59927</guid>
      <dc:creator>deega</dc:creator>
      <dc:date>2016-08-17T02:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: proc sql : when key value is missing !</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292057#M59928</link>
      <description>&lt;P&gt;It's your join type that causes the issue, just doing a left join should help, though they'd be blank, not 0&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2016 03:20:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-sql-when-key-value-is-missing/m-p/292057#M59928</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-08-17T03:20:32Z</dc:date>
    </item>
  </channel>
</rss>

