I just need to pull all the procedure codes which are not available in the claims file. But procedure code ids are available in the claims file. Here is the full query: proc sql; create table claims_data as select distinct a.patient_id ,a.claim_num ,a.service_dt ,pr1.proc_1_cd ,pr2.proc_2_cd ,pr3.proc_3_cd ,pr4.proc_4_cd ,pr5.proc_5_cd ,pr6.proc_6_cd ,pr7.proc_7_cd ,pr8.proc_8_cd ,pr9.proc_9_cd ,pr10.proc_10_cd ,pr11.proc_11_cd ,pr12.proc_12_cd ,pr13.proc_13_cd ,pr14.proc_14_cd ,pr15.proc_15_cd ,pr16.proc_16_cd ,pr17.proc_17_cd ,pr18.proc_18_cd ,pr19.proc_19_cd ,pr20.proc_20_cd from claim_file a left join proc_lookup pr1 on a.proc_1_cd_id=pr1.proc_cd_id left join proc_lookup pr2 on a.proc_2_cd_id=pr2.proc_cd_id left join proc_lookup pr3 on a.proc_3_cd_id=pr3.proc_cd_id left join proc_lookup pr4 on a.proc_4_cd_id=pr4.proc_cd_id left join proc_lookup pr5 on a.proc_5_cd_id=pr5.proc_cd_id left join proc_lookup pr6 on a.proc_6_cd_id=pr6.proc_cd_id left join proc_lookup pr7 on a.proc_7_cd_id=pr7.proc_cd_id left join proc_lookup pr8 on a.proc_8_cd_id=pr8.proc_cd_id left join proc_lookup pr9 on a.proc_9_cd_id=pr9.proc_cd_id left join proc_lookup pr10 on a.proc_10_cd_id=pr10.proc_cd_id left join proc_lookup pr11 on a.proc_11_cd_id=pr11.proc_cd_id left join proc_lookup pr12 on a.proc_12_cd_id=pr12.proc_cd_id left join proc_lookup pr13 on a.proc_13_cd_id=pr13.proc_cd_id left join proc_lookup pr14 on a.proc_14_cd_id=pr14.proc_cd_id left join proc_lookup pr15 on a.proc_15_cd_id=pr15.proc_cd_id left join proc_lookup pr16 on a.proc_16_cd_id=pr16.proc_cd_id left join proc_lookup pr17 on a.proc_17_cd_id=pr17.proc_cd_id left join proc_lookup pr18 on a.proc_18_cd_id=pr18.proc_cd_id left join proc_lookup pr19 on a.proc_19_cd_id=pr19.proc_cd_id left join proc_lookup pr20 on a.proc_20_cd_id=pr20.proc_cd_id ;quit;
... View more