DATA Step, Macro, Functions and more

SEND EMAIL ERROR

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

SEND EMAIL ERROR

I developed a code to send email when a process ends.

 

But every first time that I run the program appears the following error:

 

ERROR: Insufficient authorization to access
/is/directory/outbox.dat.

 

After the first try it works fine.

 

Can you help me to understand what error is that?

 

 

SAS CODE:

DATA WORK.SEND_EMAIL;
	
	ATTRIB NM_PROG			LENGTH= $80;
	ATTRIB CD_USUARIO		LENGTH= $10;
	ATTRIB NM_USUARIO		LENGTH= $80;
	
	
	NM_PROG = TRANWRD(&_CLIENTPROJECTNAME., ".egp", "");
	CD_USUARIO = &_CLIENTUSERID.;
	NM_USUARIO = &_CLIENTUSERNAME.;
	

RUN;


DATA _null_;
	SET WORK.SEND_EMAIL;
	
	CALL SYMPUT('NM_PROG', NM_PROG);
	CALL SYMPUT('CD_USUARIO', CD_USUARIO);
	CALL SYMPUT('NM_USUARIO', NM_USUARIO);

RUN;


PROC OPTIONS 
	GROUP=EMAIL;
RUN;

DATA _null_;
	FILE OUTBOX;

		PUT "Srs.,";
		PUT "</br>Informo que o programa <b><i>&NM_PROG.</i></b> chegou ao fim do processo.";
	
		PUT "</br></br><b>Executado por:</b> &NM_USUARIO.</br>";

RUN;

%PUT _ALL_;

FILENAME OUTBOX EMAIL
TO='email@email.com.br'
TYPE='TEXT/HTML'
SUBJECT="SAS - &NM_PROG. ";




 

 


Accepted Solutions
Solution
‎12-26-2016 12:39 PM
Trusted Advisor
Posts: 1,384

Re: SEND EMAIL ERROR

move FILENAME OUTBOX statment before using it.

That is:

 

...

FILENAME OUTBOX EMAIL
TO='email@email.com.br'
TYPE='TEXT/HTML'
SUBJECT="SAS - &NM_PROG. ";

DATA _null_;
	FILE OUTBOX;

		PUT "Srs.,";
		PUT "</br>Informo que o programa <b><i>&NM_PROG.</i></b> chegou ao fim do processo.";
	
		PUT "</br></br><b>Executado por:</b> &NM_USUARIO.</br>";

RUN;

View solution in original post


All Replies
Solution
‎12-26-2016 12:39 PM
Trusted Advisor
Posts: 1,384

Re: SEND EMAIL ERROR

move FILENAME OUTBOX statment before using it.

That is:

 

...

FILENAME OUTBOX EMAIL
TO='email@email.com.br'
TYPE='TEXT/HTML'
SUBJECT="SAS - &NM_PROG. ";

DATA _null_;
	FILE OUTBOX;

		PUT "Srs.,";
		PUT "</br>Informo que o programa <b><i>&NM_PROG.</i></b> chegou ao fim do processo.";
	
		PUT "</br></br><b>Executado por:</b> &NM_USUARIO.</br>";

RUN;
☑ This topic is SOLVED.

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

Discussion stats
  • 1 reply
  • 173 views
  • 1 like
  • 2 in conversation