I'm trying to send an email, with some information of the process.
The program sendthe email, however the body appears in blank and when I run the program shows the following error:
ERROR: Insufficient authorization to access 'directory'.
Can you help me?
SAS CODE:
DATA WORK.SEND_EMAIL;
ATTRIB CD_USUARIO LENGTH= $10;
ATTRIB NM_USUARIO LENGTH= $80;
ATTRIB CD_MAQUINA LENGTH= $15;
CD_USUARIO = &_CLIENTUSERID.;
NM_USUARIO = &_CLIENTUSERNAME.;
CD_MAQUINA = &_CLIENTMACHINE.;
RUN;
DATA _null_;
SET WORK.SEND_EMAIL;
CALL SYMPUT('CD_USUARIO', CD_USUARIO);
CALL SYMPUT('NM_USUARIO', NM_USUARIO);
CALL SYMPUT('CD_MAQUINA', CD_MAQUINA);
RUN;
FILENAME OUTBOX EMAIL
TO='email@email.com.br'
TYPE='TEXT/HTML'
SUBJECT='TESTE'
FROM='email@email.com.br';
ODS HTML BODY=OUTBOX RS=NONE;
DATA _null_;
FILE ENVIAR;
PUT "Srs, ";
PUT "ISTO É UM TESTE";
PUT " &CD_USUARIO. ";
RUN;
%PUT _ALL_;
ODS HTML CLOSE;
The error indicated that you are trying to access a folder or file for which you do not have access or permission. However the code you mentioned does not seem to access any folder. Please let me know if I am missing anything here.
Also I see that you are using the filename outbox but you mentioned in file statement ENVIAR, which I think is incorrect. Please try to replace the ENVIAR with OUTBOX and execute the code.
The error indicated that you are trying to access a folder or file for which you do not have access or permission. However the code you mentioned does not seem to access any folder. Please let me know if I am missing anything here.
Also I see that you are using the filename outbox but you mentioned in file statement ENVIAR, which I think is incorrect. Please try to replace the ENVIAR with OUTBOX and execute the code.
Thank you for the answer!
I changed the file "ENVIAR" to OUTBOX. The error stopped but it continued send a blank email.
So I put the "DATA FILE OUTBOX" before the code to send email and it worked.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.