Hi Gregg, No, Thats not i am expecting, What i am thinking is, split the POL_ID in to two parts as prifex=first 3 char of POLID , ID=rest of the char (example prefix=AZN, ID=123) proc sort data=inputdata; by ID Prefix; run; Here AZC,AZN & AZP has same ID which is 123, Now Combine the Amount from the A_N and A_P records with the A_C record. and remove AZP & AZN records from the dataset, So that out of 3 only one records remains i.e AZC123 with total sum. We can use the FIRST.VAR and retain logic, Expecting the better approach from you all Hope it give a clear picture, Let me know if you need any more information..
... View more