<?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: Error: Column was found in more than one table in the same scope. in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274590#M19052</link>
    <description>&lt;P&gt;I could't find any answer to this error on previous questions posed on the Forum.&lt;/P&gt;&lt;P&gt;Maybe it is the number of join or the order of the join (See FROM/WHERE clause in the code attached above.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jun 2016 10:00:17 GMT</pubDate>
    <dc:creator>Tanguy</dc:creator>
    <dc:date>2016-06-02T10:00:17Z</dc:date>
    <item>
      <title>Error: Column was found in more than one table in the same scope.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274587#M19051</link>
      <description>&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using EG to run SQL code. (see the code attached).&lt;/P&gt;&lt;P&gt;This code generate the following errors.&lt;/P&gt;&lt;P&gt;Does anyone know how to solve this? The code should work...The SQL seems really correct to me...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Name was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Entity_ID was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.MFI_Code was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Reported_Period was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Country was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Highest_Level_of_Consolidation was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ERROR: Column ras_var_ind_filt.Entity_Type was found in more than one table in the same scope.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;ETC.&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;</description>
      <pubDate>Thu, 02 Jun 2016 09:48:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274587#M19051</guid>
      <dc:creator>Tanguy</dc:creator>
      <dc:date>2016-06-02T09:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Column was found in more than one table in the same scope.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274590#M19052</link>
      <description>&lt;P&gt;I could't find any answer to this error on previous questions posed on the Forum.&lt;/P&gt;&lt;P&gt;Maybe it is the number of join or the order of the join (See FROM/WHERE clause in the code attached above.&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jun 2016 10:00:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274590#M19052</guid>
      <dc:creator>Tanguy</dc:creator>
      <dc:date>2016-06-02T10:00:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Column was found in more than one table in the same scope.</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274611#M19053</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry, I am not here to debug an SQL query of that size. &amp;nbsp;At a brief glimpse I can see a couple of pointers:&lt;/P&gt;
&lt;P&gt;In the first query you refer to&amp;nbsp;ras_var_ind_filt.Name, however in the from statement you put:&lt;/P&gt;
&lt;P&gt;L1RAWDAT.RAS_VAR_IND_FILT AS t3,&lt;/P&gt;
&lt;P&gt;Now the first part is the table, the as T3 is the alias. &amp;nbsp;If you specify an alias for the data table you should be using that consistently throughout the query, T3&lt;SPAN&gt;.Name, for instance. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In much the same way in your second query - which is where I presume you have the error - you are referencing one table:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;STAGING.CREDIT_RISK_MI AS t1;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But in your select statement you use T1, and&amp;nbsp;RAS_VAR_IND_FILT.CACE0100 for example, where the alias doesn't exist and nor does the table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As I said, I don't have time to debug that whole code file. &amp;nbsp;What I would suggest however is that you looko at the thing as a whole as a brief glance over it shows to me a lot of code that isn't doing anything. &amp;nbsp;You should be able to vastly simply the code byusing data step, and a summary procedure (means or summary), just as an example, the second query is basically just selecting all the data and assigning labels and formats which can be vastly simplified with lists in datastep:&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;data want;
  set have;
  format abc def ghi comma21. xyz: percent12. aa1--aa5 date9.;
  label...;
run;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2016 11:27:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Error-Column-was-found-in-more-than-one-table-in-the-same-scope/m-p/274611#M19053</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-06-02T11:27:21Z</dc:date>
    </item>
  </channel>
</rss>

