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.

 

 

 

 

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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