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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.