%macro verify(text,target); %*********************************************************************; %* *; %* MACRO: VERIFY *; %* *; %* USAGE: 1) %verify(argument,target) *; %* *; %* DESCRIPTION: *; %* This macro returns the position of the first character in the *; %* argument that is not in the target value. If every character *; %* that is in the argument is also in the target value then this *; %* fuction returns a value of 0. The syntax for its use is *; %* is similar to that of native macro functions. *; %* *; %* Eg. %let i=%verify(&argtext,&targtext) *; %* *; %* SUPPORT: sassmo *; %* NOTES: *; %* Both values to this function must have non-zero lengths or an *; %* error message will be produced. *; %* *; %*********************************************************************; %local i; %if %length(&text)=0 | %length(&target)=0 %then %do; %put ERROR: ARGUMENT TO VERIFY FUNCTION MISSING.; %goto errout; %end; %do i=1 %to %length(&text); %if ^%index(&target,%qsubstr(&text,&i,1)) %then %goto verfnd; %end; %verfnd: %if &i>%length(&text) %then 0; %else &i; %errout: %mend;