BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Bottoni
Fluorite | Level 6

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;

 

1 ACCEPTED SOLUTION

Accepted Solutions
Jagadishkatam
Amethyst | Level 16

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

2 REPLIES 2
Jagadishkatam
Amethyst | Level 16

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
Bottoni
Fluorite | Level 6

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.

 

 

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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