Hi,
when i join the below tables
APC-19477289 obs
IOTC-1057 nobs
proc sql;
create table APC_1 as
select a.*, b.PROD_NAME
from APC as left join IOTC as b
on a.INS_OP_CODE =b.INS_OP_CODE and a.TYPE_COVERAGE_CODE=b.TYPE_COV_CODE;
quit;
i am getting the count of 36605480 obs in resultant dataset, i want APC count in my dataset.
could you please help
You have multiple matches for your key variable pairs in IOTC, causing a multiplication.
Do a
proc sort data=iotc out=test nodupkey;
by ins_op_code type_cov_code;
run;
and look at the log.
Try this. In your posted code, you did not reference the table APC as a.
proc sql;
create table APC_1 as
select a.*, b.PROD_NAME
from APC as a left join IOTC as b
on a.INS_OP_CODE =b.INS_OP_CODE and a.TYPE_COVERAGE_CODE=b.TYPE_COV_CODE;
quit;
sorry its typo error.
its referred as a in the code.
Ok. Can you post your log please?
You have multiple matches for your key variable pairs in IOTC, causing a multiplication.
Do a
proc sort data=iotc out=test nodupkey;
by ins_op_code type_cov_code;
run;
and look at the log.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.