Hi All thanks for your help with this. I did not originally create this program, but changes have been made to the incoming data that are causing this array to error out. I've tried about everything that I can think which means it's probably the easiest solution. The planname used to be numeric, but it is now alphanumeric, which is causing the error. Is there a way to use the alphanumeric planname?. This isn't the entire code just a small portion of it. Thanks again for your help. data set1 set2; array old_hsp_id {999999} $ 1 _temporary_ (999999*'N'); set combine (in=a) incomingset_1(in=b rename=(start=planname) where=(put(left(trim(planname)),$unq2_1.) = 'N' and put(left(trim(planname)),$opn_1. ) = 'Y')) incomingset_2(in=c rename=(start=planname) where=(put(left(trim(planname)),$opnhspva. ) = 'Y')) end=eof; * Check for duplicates ; if (old_hsp_id (input(left(trim(planname)),6.)) = 'N') then old_hsp_id (input(left(trim(planname)),6.)) = 'Y'; else do; error 'Hospital id is duplicated'; put _all_; Terminate = 'Y'; end; run;
... View more