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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.