<?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 Fedsql Join Error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950716#M371750</link>
    <description>&lt;P&gt;You can't create tables with duplicate variable names and though must ensure that they are unique in your Select statement. That's true for any SQL flavour. Proc SQL would just throw a warning, and database SQL I know would throw an error same as Proc Fedsql.&lt;/P&gt;
&lt;P&gt;I'm not a big fan of * in the Select statement but below an example for a minimum typing approach.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class1(drop=sex) work.class2;
  set sashelp.class;
run;
proc datasets lib=work nolist nowarn;
  delete want;
quit;
proc FEDsql;
  create table want as
  select 
    t1.*
    , t2.sex
  from work.class1 t1 inner join work.class2 t2
  on t1.name=t2.name
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 14 Nov 2024 01:12:16 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2024-11-14T01:12:16Z</dc:date>
    <item>
      <title>Proc Fedsql Join Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950448#M371684</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the proc fedsql to join two datasets - however they have multiple columns with the same name which isn't allowed is there an option to accept that there are these two columns and treat them as identical because it is just a bunch of ID and Product columns. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 15:44:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950448#M371684</guid>
      <dc:creator>phopkinson</dc:creator>
      <dc:date>2024-11-12T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Fedsql Join Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950465#M371692</link>
      <description>&lt;P&gt;I do not think so. Welcome to the verbose syntax of SQL.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will just need to list the variables ("columns") that do want selected.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 16:49:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950465#M371692</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-11-12T16:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Fedsql Join Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950528#M371706</link>
      <description>&lt;P&gt;There is no general option that manges this in (fed)SQL.&lt;/P&gt;
&lt;P&gt;How to handle depends on your situation.&lt;/P&gt;
&lt;P&gt;Do you use&amp;nbsp; an inner or an outer join?&lt;/P&gt;
&lt;P&gt;Are the same name columns part of the join criteria?&lt;/P&gt;
&lt;P&gt;If not, do you expect them to have the same values in both data sets?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Nov 2024 08:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950528#M371706</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2024-11-13T08:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Fedsql Join Error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950716#M371750</link>
      <description>&lt;P&gt;You can't create tables with duplicate variable names and though must ensure that they are unique in your Select statement. That's true for any SQL flavour. Proc SQL would just throw a warning, and database SQL I know would throw an error same as Proc Fedsql.&lt;/P&gt;
&lt;P&gt;I'm not a big fan of * in the Select statement but below an example for a minimum typing approach.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.class1(drop=sex) work.class2;
  set sashelp.class;
run;
proc datasets lib=work nolist nowarn;
  delete want;
quit;
proc FEDsql;
  create table want as
  select 
    t1.*
    , t2.sex
  from work.class1 t1 inner join work.class2 t2
  on t1.name=t2.name
  ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 14 Nov 2024 01:12:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-Fedsql-Join-Error/m-p/950716#M371750</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-11-14T01:12:16Z</dc:date>
    </item>
  </channel>
</rss>

