<?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: Joining tables in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73160#M7269</link>
    <description>Is CANCERS07_AGES_1.CODE a character or numeric variable, and is CANCERC. the correct format to apply?&lt;BR /&gt;
&lt;BR /&gt;
You can change the properties of the columns you selected to remove the format or apply a different one, if necessary.  I expect the FORMAT options (EG 4.1, correct?) are added automatically.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
    <pubDate>Fri, 02 Apr 2010 11:24:15 GMT</pubDate>
    <dc:creator>ChrisHemedinger</dc:creator>
    <dc:date>2010-04-02T11:24:15Z</dc:date>
    <item>
      <title>Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73159#M7268</link>
      <description>Sorry if this has been posted before.  I'm basically trying to add a variable called "count" to another table where I can then calculate some rates.  The first table has 4 variables(code, res_ca, age, count) and the other table has 4 variables also(commarea, agegroup, pop2007, weight).  I thought the join option under the "Filter and Query" task would fix my problem.  I attempted to join the 2 tables by the variables res_ca and commarea and I got an syntax error: ERROR: Character expression requires a character format.  Both variables are character and have a width of 2. I assume the error is referring to the join.  I'm not sure.  Is this the right task to accomplish what I'm trying to do or Should I be using something else?  Any suggestions?&lt;BR /&gt;
&lt;BR /&gt;
Below is the code generated from the join:&lt;BR /&gt;
&lt;BR /&gt;
PROC SQL;&lt;BR /&gt;
 CREATE TABLE SASUSER.Query1_for_Cell_statistics_for_R AS SELECT CANCERS07_AGES_1.CODE FORMAT=CANCERC.,&lt;BR /&gt;
	 CANCERS07_AGES_1.RES_CA FORMAT=$2.,&lt;BR /&gt;
	 CANCERS07_AGES_1.AGE FORMAT=AGEES.,&lt;BR /&gt;
	 CANCERS07_AGES_1.COUNT,&lt;BR /&gt;
	 danah.Commarea FORMAT=$2.,&lt;BR /&gt;
	 danah.Agegroup,&lt;BR /&gt;
	 danah.pop2007,&lt;BR /&gt;
	 danah.weight &lt;BR /&gt;
 FROM SASUSER.CANCERS07_AGES_1 AS CANCERS07_AGES_1 &lt;BR /&gt;
	  INNER JOIN EC100004.DANAH AS danah ON (CANCERS07_AGES_1.RES_CA = danah.Commarea);&lt;BR /&gt;
QUIT;</description>
      <pubDate>Thu, 01 Apr 2010 19:36:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73159#M7268</guid>
      <dc:creator>dana_chicagohealth</dc:creator>
      <dc:date>2010-04-01T19:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73160#M7269</link>
      <description>Is CANCERS07_AGES_1.CODE a character or numeric variable, and is CANCERC. the correct format to apply?&lt;BR /&gt;
&lt;BR /&gt;
You can change the properties of the columns you selected to remove the format or apply a different one, if necessary.  I expect the FORMAT options (EG 4.1, correct?) are added automatically.&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Fri, 02 Apr 2010 11:24:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73160#M7269</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2010-04-02T11:24:15Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73161#M7270</link>
      <description>Chris,&lt;BR /&gt;
CANCERS07_AGES_1.CODE is a numeric variable and CANCERC is a numeric format I created for the variable.</description>
      <pubDate>Mon, 05 Apr 2010 14:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73161#M7270</guid>
      <dc:creator>dana_chicagohealth</dc:creator>
      <dc:date>2010-04-05T14:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73162#M7271</link>
      <description>See these SAS notes to see if they apply:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/6/239.html" target="_blank"&gt;http://support.sas.com/kb/6/239.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/6/783.html" target="_blank"&gt;http://support.sas.com/kb/6/783.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/7/665.html" target="_blank"&gt;http://support.sas.com/kb/7/665.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/kb/15/136.html" target="_blank"&gt;http://support.sas.com/kb/15/136.html&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Chris</description>
      <pubDate>Tue, 06 Apr 2010 13:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73162#M7271</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2010-04-06T13:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73163#M7272</link>
      <description>Chris,&lt;BR /&gt;
I looked at problem notes: 6239 and 6743. I corrected the columns in question and I still got the same error.</description>
      <pubDate>Tue, 06 Apr 2010 15:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73163#M7272</guid>
      <dc:creator>dana_chicagohealth</dc:creator>
      <dc:date>2010-04-06T15:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73164#M7273</link>
      <description>Suggest that you share the exact SAS log that is generating the error condition by pasting it in a post-reply for the most accurate feedback.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Tue, 06 Apr 2010 16:18:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73164#M7273</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-06T16:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73165#M7274</link>
      <description>Scott,&lt;BR /&gt;
Here is the log generated from the join:&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
1          ;*';*";*/;quit;run;&lt;BR /&gt;
2          OPTIONS PAGENO=MIN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
3          PROC SQL;&lt;BR /&gt;
3        !           VALIDATE&lt;BR /&gt;
4          SELECT CANCERS07_AGES_1.CODE FORMAT=CANCERC.,&lt;BR /&gt;
5          	 CANCERS07_AGES_1.RES_CA FORMAT=$2.,&lt;BR /&gt;
6          	 CANCERS07_AGES_1.AGE FORMAT=AGEES.,&lt;BR /&gt;
7          	 CANCERS07_AGES_1.COUNT,&lt;BR /&gt;
8          	 danah.Commarea FORMAT=$2.,&lt;BR /&gt;
9          	 danah.Agegroup,&lt;BR /&gt;
10         	 danah.pop2007,&lt;BR /&gt;
11         	 danah.weight&lt;BR /&gt;
12          FROM SASUSER.CANCERS07_AGES_1 AS CANCERS07_AGES_1&lt;BR /&gt;
13         	  INNER JOIN EC100014.DANAH AS danah ON (CANCERS07_AGES_1.RES_CA = danah.Commarea);&lt;BR /&gt;
ERROR: Character expression requires a character format.&lt;BR /&gt;
NOTE: PROC SQL set option NOEXEC and will continue to check the syntax of statements.&lt;BR /&gt;
14         QUIT;&lt;BR /&gt;
NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           0.01 seconds&lt;BR /&gt;
      cpu time            0.01 seconds&lt;BR /&gt;
      &lt;BR /&gt;
15         &lt;BR /&gt;
16         QUIT; RUN;&lt;BR /&gt;
17</description>
      <pubDate>Tue, 06 Apr 2010 16:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73165#M7274</guid>
      <dc:creator>dana_chicagohealth</dc:creator>
      <dc:date>2010-04-06T16:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73166#M7275</link>
      <description>It could be that your columns CODE and AGE which have numerical formats specified on them, are in fact char?&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Wed, 07 Apr 2010 06:22:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73166#M7275</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2010-04-07T06:22:18Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73167#M7276</link>
      <description>Linus,&lt;BR /&gt;
I checked both columns CODE and AGE and they are indeed numeric variables with numeric formats.</description>
      <pubDate>Wed, 07 Apr 2010 15:02:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73167#M7276</guid>
      <dc:creator>dana_chicagohealth</dc:creator>
      <dc:date>2010-04-07T15:02:15Z</dc:date>
    </item>
    <item>
      <title>Re: Joining tables</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73168#M7277</link>
      <description>Suggest you analyze your code and verify that the appropriate FORMAT= "output formats" are also being applied to the different SAS variable types, those being either CHARACTER or NUMERIC, as the error is conveying.  You may find a SAS CONTENTS  report useful here for your SAS variables.&lt;BR /&gt;
&lt;BR /&gt;
One approach would be to use "code commenting" to iteratively reduce your logic until the query works and then work to add back in (through uncommenting) your code-pieces in your PROC SQL query.  With this approach, you will find that desk-checking will reveal the problem cause, and then come back to the forum for input/feedback.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Wed, 07 Apr 2010 15:59:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Joining-tables/m-p/73168#M7277</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-04-07T15:59:00Z</dc:date>
    </item>
  </channel>
</rss>

