Hi Arthur - sorry if i was not clear. Lets try the below code. I am running below code for my output. Note I am using this code 5 different times for my final output. Any advise how to improve the code for better execution? Thanks This is a pseudo code: data com_Nl ; set com_mis.cust(where=(CUST_ID IN ('00203046', '00232425'))); cust_num=((compress(CUST_ID,"0123456789","k"))*1); run; data com_nl (keep= cust_id cust_num cus_cd current_position); set com_nl; run; data want_cus (keep=want_cus_cd cus_agency_cd); set com_mis.want_cusestor; run; proc sort data=com_nl; by cus_cd; run; proc sort data=want_cus; by want_cus_cd; run; data combined; merge com_nl(in=a) want_cus (in=b rename=(want_cus_cd=cus_cd)); if a=b; by cus_cd; run;
... View more