DATA Step, Macro, Functions and more

Email body error

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

Email body error

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;

 


Accepted Solutions
Solution
‎12-26-2016 06:34 AM
Trusted Advisor
Posts: 1,137

Re: Email body error

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. 

Thanks,
Jag

View solution in original post


All Replies
Solution
‎12-26-2016 06:34 AM
Trusted Advisor
Posts: 1,137

Re: Email body error

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. 

Thanks,
Jag
Occasional Contributor
Posts: 9

Re: Email body error

Posted in reply to Jagadishkatam

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.

 

 

 

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 173 views
  • 0 likes
  • 2 in conversation