<?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 could not be found in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743045#M29223</link>
    <description>&lt;P&gt;That' pretty clear.&lt;/P&gt;
&lt;P&gt;The data set sid.plus4_zip_summary_us&amp;nbsp; does not contain a variable name&lt;FONT color="#000000"&gt; postal_cd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;If you intend to create the code then you need to watch where you are placing ( ).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Maybe:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table TEST as
   select b.state_nm as state_c
   ,a.*
   ,a.full_zip as ZIP9
   ,
   from (select *, substr(full_zip,1,5) as postal_cd
         from sid.plus4_zip_summary_us) a
   inner join temp b
   on b.zip_char_cd=a.postal_cd
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;You were attempting to create the variable Postal_ct after the inner join. The&amp;nbsp; above creates it in a subquery so is in the alias A data.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 20:28:35 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-05-21T20:28:35Z</dc:date>
    <item>
      <title>ERROR: Column could not be found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743029#M29220</link>
      <description>&lt;P&gt;I'm trying to create a column (postal_cd) and then join another table from that column, but I received this error:&lt;/P&gt;&lt;P&gt;ERROR: Column postal_cd could not be found in the table/view identified with the correlation name A.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table TEST as&lt;BR /&gt;(select b.state_nm as state_c&lt;BR /&gt;,a.*&lt;BR /&gt;,a.full_zip as ZIP9&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;,substr(full_zip,1,5) as postal_cd&lt;/FONT&gt;&lt;BR /&gt;from sid.plus4_zip_summary_us a&lt;BR /&gt;inner join temp b&lt;BR /&gt;&lt;FONT color="#FF6600"&gt;on b.zip_char_cd=a.postal_cd&lt;/FONT&gt;&lt;BR /&gt;);&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 19:27:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743029#M29220</guid>
      <dc:creator>jakeroth424</dc:creator>
      <dc:date>2021-05-21T19:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Column could not be found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743043#M29222</link>
      <description>&lt;P&gt;The table with the alias&amp;nbsp;&lt;STRONG&gt;a&amp;nbsp;&lt;/STRONG&gt;is&amp;nbsp;&lt;EM&gt;sid.plus4_zip_summary_us.&amp;nbsp;&lt;/EM&gt;That table does not have postal_cd, so a reference to a.postal_cd will give that error. However, that table does have full_zip, from which you are getting postal_cd. So you can just reference the substring of full_zip in your join:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table TEST as
(select b.state_nm as state_c
,a.*
,a.full_zip as ZIP9
,substr(full_zip,1,5) as postal_cd
from sid.plus4_zip_summary_us a
inner join temp b
on b.zip_char_cd=substr(a.full_zip,1,5)
);
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 May 2021 20:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743043#M29222</guid>
      <dc:creator>mklangley</dc:creator>
      <dc:date>2021-05-21T20:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: Column could not be found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743045#M29223</link>
      <description>&lt;P&gt;That' pretty clear.&lt;/P&gt;
&lt;P&gt;The data set sid.plus4_zip_summary_us&amp;nbsp; does not contain a variable name&lt;FONT color="#000000"&gt; postal_cd&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;If you intend to create the code then you need to watch where you are placing ( ).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;Maybe:&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql;
   create table TEST as
   select b.state_nm as state_c
   ,a.*
   ,a.full_zip as ZIP9
   ,
   from (select *, substr(full_zip,1,5) as postal_cd
         from sid.plus4_zip_summary_us) a
   inner join temp b
   on b.zip_char_cd=a.postal_cd
   ;
quit;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;You were attempting to create the variable Postal_ct after the inner join. The&amp;nbsp; above creates it in a subquery so is in the alias A data.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 20:28:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/ERROR-Column-could-not-be-found/m-p/743045#M29223</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-21T20:28:35Z</dc:date>
    </item>
  </channel>
</rss>

