<?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 Treating a warning that doesn't make sense to me (from a basic join) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775865#M246652</link>
    <description>&lt;P&gt;Say I want to create a table called POLICY. It should be identical to the source table POLICY_SRC, except that it should only contain the policies that are represented in the source table POLICY_LOAD. The primary key in all tables is policy_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table POLICY as
	select * from POLICY_SRC src
	inner join POLICY_LOAD load on (src.policy_id = load.policy_id);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This gives the following warning:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;WARNING: Variable policy_id already exists on file WORK.POLICY.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I only select the policy_id column from POLICY_SRC. So why this error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess the code also selects policy_id from POLICY_LOAD, because of the join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would you resolve this warning? Can I drop the superfluous column somehow, in this proc sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:The reason why I'm doing a SELECT * is that the actual table contain around 150+ columns, so I'd prefer not to list them all if it can be avoided. I'd like to just simply select * columns from POLICY_INPUT.&lt;/P&gt;</description>
    <pubDate>Fri, 22 Oct 2021 13:25:11 GMT</pubDate>
    <dc:creator>EinarRoed</dc:creator>
    <dc:date>2021-10-22T13:25:11Z</dc:date>
    <item>
      <title>Treating a warning that doesn't make sense to me (from a basic join)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775865#M246652</link>
      <description>&lt;P&gt;Say I want to create a table called POLICY. It should be identical to the source table POLICY_SRC, except that it should only contain the policies that are represented in the source table POLICY_LOAD. The primary key in all tables is policy_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table POLICY as
	select * from POLICY_SRC src
	inner join POLICY_LOAD load on (src.policy_id = load.policy_id);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This gives the following warning:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;WARNING: Variable policy_id already exists on file WORK.POLICY.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I only select the policy_id column from POLICY_SRC. So why this error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I guess the code also selects policy_id from POLICY_LOAD, because of the join.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How would you resolve this warning? Can I drop the superfluous column somehow, in this proc sql?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit:The reason why I'm doing a SELECT * is that the actual table contain around 150+ columns, so I'd prefer not to list them all if it can be avoided. I'd like to just simply select * columns from POLICY_INPUT.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 13:25:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775865#M246652</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2021-10-22T13:25:11Z</dc:date>
    </item>
    <item>
      <title>Re: Treating a warning that doesn't make sense to me (from a basic join)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775871#M246653</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/33000"&gt;@EinarRoed&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Say I want to create a table called POLICY. It should be identical to the source table POLICY_SRC, except that it should only contain the policies that are represented in the source table POLICY_LOAD. The primary key in all tables is policy_id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
	create table POLICY as
	select * from POLICY_SRC src
	inner join POLICY_LOAD load on (src.policy_id = load.policy_id);
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This gives the following warning:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;WARNING: Variable policy_id already exists on file WORK.POLICY.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I only select the policy_id column from POLICY_SRC. So why this error?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is not correct. You have selected &lt;FONT color="#FF0000"&gt;all&lt;/FONT&gt; variables from POLICY_SRC. That's what the * indicates. There is a variable named POLICY_ID in both data sets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In this case, I think it would be fine to ignore the warning, as the information it is providing is expected. (Sometimes warnings provide unexpected information, and then you should not ignore the warning)&lt;/P&gt;</description>
      <pubDate>Fri, 22 Oct 2021 13:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775871#M246653</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-22T13:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Treating a warning that doesn't make sense to me (from a basic join)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775875#M246654</link>
      <description>For some reason I thought that the SELECT would only select policy_id from the "FROM-table" and not from the "JOIN-table" unless specified. But yeah I see that it makes sense that it selects all columns from both tables. I'll just live with the warning then, thanks.</description>
      <pubDate>Fri, 22 Oct 2021 13:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treating-a-warning-that-doesn-t-make-sense-to-me-from-a-basic/m-p/775875#M246654</guid>
      <dc:creator>EinarRoed</dc:creator>
      <dc:date>2021-10-22T13:43:47Z</dc:date>
    </item>
  </channel>
</rss>

