mardi 31 mars 2015

SAS Assign variable if it meets any of multiple string requirements


if find(upcase(owner,in('ADMIN'|'ASSOC'|'BANK'|'CHRIST'|'CHURCH'|'CITY'|)))
THEN NameFlag = 1;
ELSE NameFlag = 0;
IF NameFlag > 0 then NameExclusion=1;
else NameExclusion=0;


I want this if statement to search variable OWNER for any string featured in the in statement and assign a flag if it hits. Ideally I'd like to point this string at a separate data-set that I can just update on the fly, but I'm not quite sure I know how to do that yet. Any help would be appreciated.


Thanks!


Aucun commentaire:

Enregistrer un commentaire