Hi Nicnad, Add the conditional statement in red font and delete the statement in blue font, data data work.ind14_15_16; set mylist.test end=eof; by objet; /*delete the statement, it might create problem in future if the data is not sorted based on objet*/ retain count_gafi count_sanction count_person; if _n_ eq 1 then do; count_gafi=0; count_sanction=0; count_person=0; end; if index(lowcase(strip(objet)),"'bolivie','équateur','equateur','éthiopie','ethiopie','indonesie','kenya', 'nigeria','nigéria','pakistan', 'sao','sri lanka', 'thailand', 'thailande','tailande','turquie', 'tanzanie','viet','yemen','yémen'") >0 then count_gafi=count_gafi+1; else if index(lowcase(strip(objet)),"'bélarus','belarus', 'corée du nord', 'rpdc', 'coree du nord','ivoire' , 'congo', 'chine' , 'cuba' , 'érythrée' , 'erythree', 'iran' , 'iraq' , 'liberia' , 'libéria', 'libye' , 'myanmar', 'birmanie', 'somalie' , 'sierra' , 'soudan', 'syrie', 'zimbabwe'") >0 then count_sanction=count_sanction+1; else count_person = count_person + 1; /* If the record is not part of count_gafi or count_sanction, I want it to be part of count_person */ if eof; run; Regards Sylas.J
... View more