<?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 Ambiguous reference, column product_type is in more than one table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ambiguous-reference-column-product-type-is-in-more-than-one/m-p/839612#M331964</link>
    <description>&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table&lt;BR /&gt;current as&lt;BR /&gt;select market, product_type, chains, facility_name , facility_mpin , coalesce(member_status_flag,new_eff_flag) as Flag, count&lt;BR /&gt;from&lt;BR /&gt;(&lt;BR /&gt;select market,product_type, chains, facility_name , facility_mpin , member_status_flag,&lt;BR /&gt;count(member_status_flag) as count&lt;/P&gt;&lt;P&gt;from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;group by market, product_type, chains, facility_name, facility_mpin , member_status_flag&lt;/P&gt;&lt;P&gt;outer union corr&lt;/P&gt;&lt;P&gt;select market, product_type, chains, facility_name , facility_mpin,new_eff_flag,&lt;BR /&gt;count(new_eff_flag) as count&lt;BR /&gt;from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;where new_eff_flag is not missing&lt;BR /&gt;group by market, product_type, chains, facility_name, facility_mpin ,new_eff_flag&lt;BR /&gt;)&lt;BR /&gt;order by market, product_type, chains, facility_name , facility_mpin&lt;BR /&gt;;&lt;BR /&gt;quit;&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;Log:&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 proc sql noprint;&lt;BR /&gt;27 create table&lt;BR /&gt;28 current as&lt;BR /&gt;29 select market, product_type, chains, facility_name , facility_mpin , coalesce(member_status_flag,new_eff_flag) as Flag,&lt;BR /&gt;29 ! count&lt;BR /&gt;30 from&lt;BR /&gt;31 (&lt;BR /&gt;32 select market,product_type, chains, facility_name , facility_mpin , member_status_flag,&lt;BR /&gt;33 count(member_status_flag) as count&lt;BR /&gt;34&lt;BR /&gt;35 from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;36 group by market, product_type, chains, facility_name, facility_mpin , member_status_flag&lt;BR /&gt;37&lt;BR /&gt;38 outer union corr&lt;BR /&gt;39&lt;BR /&gt;40 select market, product_type, chains, facility_name , facility_mpin,new_eff_flag,&lt;BR /&gt;41 count(new_eff_flag) as count&lt;BR /&gt;42 from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;43 where new_eff_flag is not missing&lt;BR /&gt;44 group by market, product_type, chains, facility_name, facility_mpin ,new_eff_flag&lt;BR /&gt;45 )&lt;BR /&gt;46 order by market, product_type, chains, facility_name , facility_mpin&lt;BR /&gt;47 ;&lt;BR /&gt;ERROR: Ambiguous reference, column product_type is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column chains is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column product_type is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column chains is in more than one table.&lt;BR /&gt;WARNING: Column named product_type is duplicated in a select expression (or a view). Explicit references to it will be to the first&lt;BR /&gt;one.&lt;BR /&gt;WARNING: Column named chains is duplicated in a select expression (or a view). Explicit references to it will be to the first one.&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: member_status_flag, new_eff_flag.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Oct 2022 12:51:52 GMT</pubDate>
    <dc:creator>lankamanoja</dc:creator>
    <dc:date>2022-10-20T12:51:52Z</dc:date>
    <item>
      <title>Ambiguous reference, column product_type is in more than one table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ambiguous-reference-column-product-type-is-in-more-than-one/m-p/839612#M331964</link>
      <description>&lt;P&gt;proc sql noprint;&lt;BR /&gt;create table&lt;BR /&gt;current as&lt;BR /&gt;select market, product_type, chains, facility_name , facility_mpin , coalesce(member_status_flag,new_eff_flag) as Flag, count&lt;BR /&gt;from&lt;BR /&gt;(&lt;BR /&gt;select market,product_type, chains, facility_name , facility_mpin , member_status_flag,&lt;BR /&gt;count(member_status_flag) as count&lt;/P&gt;&lt;P&gt;from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;group by market, product_type, chains, facility_name, facility_mpin , member_status_flag&lt;/P&gt;&lt;P&gt;outer union corr&lt;/P&gt;&lt;P&gt;select market, product_type, chains, facility_name , facility_mpin,new_eff_flag,&lt;BR /&gt;count(new_eff_flag) as count&lt;BR /&gt;from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;where new_eff_flag is not missing&lt;BR /&gt;group by market, product_type, chains, facility_name, facility_mpin ,new_eff_flag&lt;BR /&gt;)&lt;BR /&gt;order by market, product_type, chains, facility_name , facility_mpin&lt;BR /&gt;;&lt;BR /&gt;quit;&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;Log:&lt;/P&gt;&lt;P&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR&lt;BR /&gt;24&lt;BR /&gt;25 GOPTIONS ACCESSIBLE;&lt;BR /&gt;26 proc sql noprint;&lt;BR /&gt;27 create table&lt;BR /&gt;28 current as&lt;BR /&gt;29 select market, product_type, chains, facility_name , facility_mpin , coalesce(member_status_flag,new_eff_flag) as Flag,&lt;BR /&gt;29 ! count&lt;BR /&gt;30 from&lt;BR /&gt;31 (&lt;BR /&gt;32 select market,product_type, chains, facility_name , facility_mpin , member_status_flag,&lt;BR /&gt;33 count(member_status_flag) as count&lt;BR /&gt;34&lt;BR /&gt;35 from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;36 group by market, product_type, chains, facility_name, facility_mpin , member_status_flag&lt;BR /&gt;37&lt;BR /&gt;38 outer union corr&lt;BR /&gt;39&lt;BR /&gt;40 select market, product_type, chains, facility_name , facility_mpin,new_eff_flag,&lt;BR /&gt;41 count(new_eff_flag) as count&lt;BR /&gt;42 from datloc.FIN360_MBR_ROSTER_RPT_Curr&lt;BR /&gt;43 where new_eff_flag is not missing&lt;BR /&gt;44 group by market, product_type, chains, facility_name, facility_mpin ,new_eff_flag&lt;BR /&gt;45 )&lt;BR /&gt;46 order by market, product_type, chains, facility_name , facility_mpin&lt;BR /&gt;47 ;&lt;BR /&gt;ERROR: Ambiguous reference, column product_type is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column chains is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column product_type is in more than one table.&lt;BR /&gt;ERROR: Ambiguous reference, column chains is in more than one table.&lt;BR /&gt;WARNING: Column named product_type is duplicated in a select expression (or a view). Explicit references to it will be to the first&lt;BR /&gt;one.&lt;BR /&gt;WARNING: Column named chains is duplicated in a select expression (or a view). Explicit references to it will be to the first one.&lt;BR /&gt;ERROR: The following columns were not found in the contributing tables: member_status_flag, new_eff_flag.&lt;BR /&gt;NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 12:51:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ambiguous-reference-column-product-type-is-in-more-than-one/m-p/839612#M331964</guid>
      <dc:creator>lankamanoja</dc:creator>
      <dc:date>2022-10-20T12:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Statement is not valid or it is used out of proper order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ambiguous-reference-column-product-type-is-in-more-than-one/m-p/839616#M331967</link>
      <description>&lt;P&gt;Whenever you get an error in the log (that's 100% of the time), you need to show us the &lt;FONT color="#FF0000"&gt;ENTIRE&lt;/FONT&gt; log for this DATA step or PROC. Please copy the &lt;FONT color="#FF0000"&gt;ENTIRE&lt;/FONT&gt; log for this DATA step or PROC and then paste it into the window that appears when you click on the &amp;lt;/&amp;gt; icon.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1663012019648.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/75161i0E71B1489A6C9839/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1663012019648.png" alt="PaigeMiller_0-1663012019648.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Additional comment:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data datloc.FIN360_MBR_ROSTER_RPT_Curr;
set datloc.FIN360_MBR_ROSTER_RPT_Curr;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it is usually considered to be a poor programming practice to overwrite your data set with a new data set of the exact same name, this erases the original data set (which you might need to go back to at some point). Better would be this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data datloc.FIN360_MBR_ROSTER_RPT_Curr;
set FIN360_MBR_ROSTER_RPT_Curr2;&lt;/CODE&gt;&lt;/PRE&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;</description>
      <pubDate>Thu, 20 Oct 2022 11:58:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ambiguous-reference-column-product-type-is-in-more-than-one/m-p/839616#M331967</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-10-20T11:58:58Z</dc:date>
    </item>
  </channel>
</rss>

