Hi all,
I generate a code below with a couple of arrays, is there any way to shorten the code ?
data filter_each_country;
set concatenate_;
array delwords1 {18} $ 15 _temporary_ ('PN' 'PNA' 'PNB' 'PNC' 'PND' 'PNE' 'PNF'
'PNG' 'RCSA' 'RCTB' 'PNDEAD' 'PNADEAD' 'PNBDEAD' 'PNCDEAD' 'PNDDEAD' 'PNEDEAD' 'PNFDEAD' 'PNGDEAD');
do i= 1 to dim(delwords1);
if GEOGN ='BRAZIL' and findw(ENAME,delwords1[i],'','eir') >0 then
delete;
end;
array delwords2 {3} $ 15 _temporary_ ('PFCL' 'PRIVILEGIADAS' 'PRVLG');
do i= 1 to dim(delwords2);
if GEOGN ='COLOMBIA' and findw(ENAME,delwords2[i],'','eir') >0 then
delete;
end;
array delwords3 {2} $ 15 _temporary_ ('PR' 'PB');
do i= 1 to dim(delwords3);
if GEOGN ='GREECE' and findw(ENAME,delwords3[i],'','eir') >0 then
delete;
end;
array delwords4 {4} $ 15 _temporary_ ('FB' 'FBDEAD' 'RTS' 'RIGHTS');
do i= 1 to dim(delwords4);
if GEOGN ='INDONESIA' and findw(ENAME,delwords4[i],'','eir') >0 then
delete;
end;
/*Around 20 arrays*/
run;
Warm regards and thanks.
... View more