<?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: The following columns were not found in the contributing tables in Developers</title>
    <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250619#M4849</link>
    <description>&lt;P&gt;Instead of writing the connect to, and select ... from connection to(), just issue a libname statemnt that has the corresponing inforamtion that you hve in your connet to clause. See online doc for syntax/examples.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sqldb &lt;EM&gt;your oledb connection options goes here&lt;/EM&gt;;

proc sql;
   create table CHCSS as
      select project, substr(site,1,4) as site, subject.....
      from sqldb.V_D3250C00018_CHCSS
      where environmentname='PROD' and userid=57
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 17 Feb 2016 14:01:15 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2016-02-17T14:01:15Z</dc:date>
    <item>
      <title>The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250545#M4838</link>
      <description>&lt;P&gt;proc sql noprint;&lt;BR /&gt;connect to odbc as sqldb(&amp;amp;odbc_conn);&lt;BR /&gt;create table CHCSS as&lt;BR /&gt;select&lt;BR /&gt;'Project'n label='Project' length=200 format=$200. informat=$200.,&lt;BR /&gt;'site'n label='Site',&lt;BR /&gt;'Subject'n label='Subject',&lt;BR /&gt;'UniqueIdentifier'n label='UniqueIdentifier' length=200 format=$200. informat=$200.,&lt;BR /&gt;'CHCSCDAT_INT'n label='Health care contact (Non-asthma) Date'&lt;BR /&gt;from connection to sqldb (&lt;BR /&gt;select&lt;BR /&gt;Project as Project,&lt;BR /&gt;SUBSTRING(Site,1,4) as Site,&lt;BR /&gt;Subject as Subject,&lt;BR /&gt;project + '-' + site + '-' + subject + '-' + LTRIM(RTRIM(InstanceName)) + '-' + cast(INSTANCEREPEATNUMBER as varchar(10)) + '-' + cast(RECORDPOSITION as varchar(10)) + '-' + cast(INSTANCEID as varchar(10)) + '-' + cast(FOLDERNAME as varchar(100)) + '-' + cast(DATAPAGEID as varchar(10)) + '-' + cast(RECORDID as varchar(10)) as 'UniqueIdentifier',&lt;BR /&gt;Convert(varchar(10),CHCSCDAT_INT,21) as 'CHCSCDAT_INT'&lt;BR /&gt;from dbo.V_D3250C00018_CHCSS&lt;BR /&gt;where environmentname='PROD' and userid=57);&lt;BR /&gt;disconnect from sqldb;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here Unique identifier is not part of the &lt;SPAN&gt;V_D3250C00018_CHCSS table somehow we need to get the data for this column as combination of the other columns.Please suggest me whats need to be incurred in this program to avoid the error.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 09:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250545#M4838</guid>
      <dc:creator>sravan1</dc:creator>
      <dc:date>2016-02-17T09:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250548#M4839</link>
      <description>&lt;P&gt;a) which "following columns" were not found? Please the log of the complete SQL step&lt;/P&gt;
&lt;P&gt;b) you don't need the '.....'n around the names in the SAS, and the single quotes in the SQL passthrough, as all are valid names already.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 09:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250548#M4839</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T09:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250552#M4840</link>
      <description>&lt;P&gt;What does this return to SAS, look at the properties of the dataset:&lt;/P&gt;
&lt;PRE&gt;proc sql noprint;
  connect to ODBC as SQLDB(&amp;amp;ODBC_CONN);
  create table CHCSS as
  select *
  from CONNECTION TO SQLDB (
    select  Project,
            SUBSTRING(Site,1,4) as Site,
            Subject as Subject,
            project + '-' + site + '-' + subject + '-' + LTRIM(RTRIM(InstanceName)) + '-' + cast(INSTANCEREPEATNUMBER as varchar(10)) + '-' + cast(RECORDPOSITION as varchar(10)) + '-' + cast(INSTANCEID as varchar(10)) + '-' + cast(FOLDERNAME as varchar(100)) + '-' + cast(DATAPAGEID as varchar(10)) + '-' + cast(RECORDID as varchar(10)) as UniqueIdentifier,
            Convert(varchar(10),CHCSCDAT_INT,21) as CHCSCDAT_INT
    from    dbo.V_D3250C00018_CHCSS
    where   environmentname='PROD' and userid=57);
  disconnect from sqldb;
quit;
&lt;/PRE&gt;
&lt;P&gt;Note, you can use the {i} above a post to keep formatting on code - makes it far easier to read. &amp;nbsp;Also note, I took the quotes from around UniqueIdentifier and CHCSCDAT_INT, not sure these are correct. &amp;nbsp;The log would also help.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 09:55:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250552#M4840</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-02-17T09:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250557#M4841</link>
      <description>&lt;P&gt;You could try to use implicit pass thru. This would simplify your code, and make trouble shooting&amp;nbsp;easier.&lt;/P&gt;
&lt;P&gt;Most of your cast operations may be done automatically by the SAS libname engine.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 10:14:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250557#M4841</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-17T10:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250560#M4842</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The uniqueidentifier&amp;nbsp;columns were not found in the contributi&lt;/SPAN&gt;&lt;SPAN&gt;ng tables this was the error message&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 10:42:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250560#M4842</guid>
      <dc:creator>sravan1</dc:creator>
      <dc:date>2016-02-17T10:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250570#M4843</link>
      <description>&lt;P&gt;Then I'd try to run the subquery in the native "sqldb" environment to see what happens there.&lt;BR /&gt;&lt;BR /&gt;Or pull the creation of the uniqueidentifier over into SAS (as &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674" target="_self"&gt;LinusH&lt;/A&gt; recommmended), so the pass-through SQL is kept as simple as possible.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:16:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250570#M4843</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T11:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250573#M4844</link>
      <description>&lt;P&gt;what does implicit pass thru can u negotiate with program example since am sas beginner&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250573#M4844</guid>
      <dc:creator>sravan1</dc:creator>
      <dc:date>2016-02-17T11:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250574#M4845</link>
      <description>&lt;P&gt;when i am executing in SAS Editor it is giveing proper results but when im trying to execute through batch file it throws the error mentioned by me above.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:37:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250574#M4845</guid>
      <dc:creator>sravan1</dc:creator>
      <dc:date>2016-02-17T11:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250577#M4846</link>
      <description>&lt;P&gt;Your batch may run in a different context than your interactive SAS (other user, other autoexec &amp;amp; config, missing system environment variables etc) with regards to the DB access&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:46:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250577#M4846</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T11:46:04Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250580#M4847</link>
      <description>&lt;P&gt;No other direct fetch from the DB is fetching correctly through batch as well but since in this that UniqueIdentifier is a derived col there is something wrong which im unable to figure it off.i think the configurations and the user settings is correctly created according to the context.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 11:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250580#M4847</guid>
      <dc:creator>sravan1</dc:creator>
      <dc:date>2016-02-17T11:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250583#M4848</link>
      <description>&lt;P&gt;Fetch all columns as is in the pass-through and create the unique identifier in SAS with SAS means.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 12:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250583#M4848</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-02-17T12:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: The following columns were not found in the contributing tables</title>
      <link>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250619#M4849</link>
      <description>&lt;P&gt;Instead of writing the connect to, and select ... from connection to(), just issue a libname statemnt that has the corresponing inforamtion that you hve in your connet to clause. See online doc for syntax/examples.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname sqldb &lt;EM&gt;your oledb connection options goes here&lt;/EM&gt;;

proc sql;
   create table CHCSS as
      select project, substr(site,1,4) as site, subject.....
      from sqldb.V_D3250C00018_CHCSS
      where environmentname='PROD' and userid=57
   ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Feb 2016 14:01:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/The-following-columns-were-not-found-in-the-contributing-tables/m-p/250619#M4849</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-02-17T14:01:15Z</dc:date>
    </item>
  </channel>
</rss>

