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?
Below is the code generated from the join:
PROC SQL;
CREATE TABLE SASUSER.Query1_for_Cell_statistics_for_R AS SELECT CANCERS07_AGES_1.CODE FORMAT=CANCERC.,
CANCERS07_AGES_1.RES_CA FORMAT=$2.,
CANCERS07_AGES_1.AGE FORMAT=AGEES.,
CANCERS07_AGES_1.COUNT,
danah.Commarea FORMAT=$2.,
danah.Agegroup,
danah.pop2007,
danah.weight
FROM SASUSER.CANCERS07_AGES_1 AS CANCERS07_AGES_1
INNER JOIN EC100004.DANAH AS danah ON (CANCERS07_AGES_1.RES_CA = danah.Commarea);
QUIT;