Hi All, I'm very new to SAS Base so forgive if this question seems basic. I've created a Macro that emails a PowerPoint file to a list of emails. The list will contain at most 8 email addresses and are inputted into the Macro via Macro variables and will be of the form email_1="John.Smith@abc.ie", (note the "" are required). If only a few emails are required then the email arguments are left blank, i.e. email_2 = A colleague mentioned that a security measure should be put on the list of emails such that if the email address is external, i.e. not "@abc.ie" or (blank) then the Macro should not run or the PowerPoint should not be emailed to these emails. What I tried to do was the following within the Macro: /*Note this is repeated 8 times for each macro email variable input*/ %if substr(&email_1.,length(&email_1.)-5,6) not in ('abc.ie', '') %then %do; %let email_1 = ''; %put &email_1; %end; I.e. if the email is not blank or is not an abc.ie. email then replace the email variable with a blank. However when I run the above I get the following error: ERROR: Required operator not found in expression: substr(&email_1.,length(&email_1.)-5,6) %not %in ('abc.ie', '') Any ideas on what the problem could be? I've tried a number of variations and done some Googling but have had no luck. If this is the wrong place to post then please let me know. Also not the internal email address will always end in '@abc.ie'. If you need some data, let me know and I an create some dummy data. Kind Regards, Lorcan
... View more