It should not matter how large the database being searched is (other than performance). But if you meant that you need to allow the user to enter a list of a million customer names then do not use that type of prompt. Instead have them upload a DATASET.
The point is that your code it not even trying to use all of the values the user entered. Your code is only using the first value. The first value will be placed in the macro variable without a numeric suffix and also into the macro variable with a suffix of 1. The second value will only be placed in the macro variable with the suffix of 2.
So what code do you want to generate when the user enters more than one name?
Perhaps something like using FINDW() to check if any of the names appears in any of the variables of interest.
and (findw(catx('|',R_SURNAME_OR_LEGALENTITYNAME,R_NAME_OR_TRADINGNAME,INDIVIDUAL3PARTYSURNAME,INDIVIDUAL3PARTYNAME)
,"&resident_customer1",'|','i')
or findw(catx('|',R_SURNAME_OR_LEGALENTITYNAME,R_NAME_OR_TRADINGNAME,INDIVIDUAL3PARTYSURNAME,INDIVIDUAL3PARTYNAME)
,"&resident_customer2",'|','i')
...
)
;
You can use a %DO loop to generate that code.
... and (
%do i=1 %to &resident_customer_count ;
%if &i=1 %then %let resident_customer1=&resident_customer;
%else or ;
findw(catx('|',R_SURNAME_OR_LEGALENTITYNAME,R_NAME_OR_TRADINGNAME,INDIVIDUAL3PARTYSURNAME,INDIVIDUAL3PARTYNAME)
,"&&resident_customer&i",'|','i')
%end;
)
... View more