Hi SBB, Thanks for the reply. Below is the code and the log. Basically I need to double quote emails in the TO= statement. Believe that would solve the issue data test; email="testing o'brien@gmail.com"; run; proc sql noprint; select email into : email from test; quit; options symbolgen mprint mlogic; %put email=%nrbquote(&email.); %macro mail; filename MailBox EMAIL FROM = 'testing@gmail.com>' TO = %nrbquote(&email.) SUBJECT = "My Email Is Not Working"; data _null_; file MailBox; put "Hello" ; put " " ; run; %mend mail; %mail; LOG: 94 options symbolgen mprint mlogic; 95 96 %put email=%nrbquote(&email.); SYMBOLGEN: Macro variable EMAIL resolves to testing o'brien@gmail.com email=testing o'brien@gmail.com 97 %macro mail; 98 99 filename MailBox 100 EMAIL 101 FROM = 'testing@gmail.com>' 102 TO = %nrbquote(&email.) 103 SUBJECT = "My Email Is Not Working"; 104 data _null_; 105 file MailBox; 106 put "Hello" ; 107 put " " ; 108 run; 109 110 %mend mail; 111 112 %mail; MLOGIC(MAIL): Beginning execution. SYMBOLGEN: Macro variable EMAIL resolves to testing o'brien@gmail.com NOTE: Line generated by the macro function "NRBQUOTE". 1 testing o'brien@gmail.com ----- 23 MPRINT(MAIL): filename MailBox EMAIL FROM = 'testing@gmail.com>' TO = testing o'brien@gmail.com SUBJECT = "My Email Is Not Working"; ERROR: Error in the FILENAME statement. MPRINT(MAIL): data _null_; MPRINT(MAIL): file MailBox; MPRINT(MAIL): put "Hello" ; MPRINT(MAIL): put " " ; MPRINT(MAIL): run; ERROR 23-2: Invalid option name brien. NOTE: The file MAILBOX is: Filename=C:\Users\212441413\mailbox.dat, RECFM=V,LRECL=256,File Size (bytes)=0, Last Modified=26Mar2015:00:35:04, Create Time=26Mar2015:00:14:58
... View more