BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Romanojr
Calcite | Level 5
I got the error below and I know that can't identify what could be wrong in the code.  =Anyone know the answer



NOTE: Writing HTML Body file: OUTBOX
NOTE: There were 5 observations read from the data set TMP.XXXX
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.01 seconds
cpu time 0.00 seconds

Message sent
To: 'fulano@XXXX.com.br'
Cc: 'beltrano@XXXX.com.br'
Bcc:
Subject: Atualização de cadastro feitas entre as data movimento: INTNX('MONTH1', DATE(),-5, 'E') e INTNX('MONTH1', DATE(), -2, 'E')
Attachments:
%EMAIL();
ERROR 180-322: Statement is not valid or it is used out of proper order.

 

_________________________________________________________________________________________________

/* CODE */
__________________________________________________________________________________________

 

%LET DTMVTFIM = INTNX('MONTH1', DATE(), &DT_INI., 'E');
%LET DTMVTINI = INTNX('MONTH1', DATE(),&DT_FIM., 'E');

%MACRO EMAIL;

/*ENVIANDO E-MAIL */
options emailsys=smtp emailhost='smtp.XXXX.com.br' emailport=25 SPOOL;

filename outbox email
from='naoresponder@XXXX.com.br'
to=('fulano@XXXX.com.br')
cc = ('beltrano@XXXX.com.br')
type='text/html'
subject="Atualização de cadastro feitas entre as data movimento: &DTMVTINI. e &DTMVTFIM. ";

ods html body=outbox style=htmlblue;
ods escapechar="^";
ods text = "^Identificamos que no periodo de &DTMVTINI. e &DTMVTFIM. ";
ods text = " ";
ods text = "^OS nomes abaixo para atualização do cadastro";

PROC PRINT DATA=TMP.XXXXXXX_FINAL NOOBS
STYLE(HEADER)={JUST=C FOREGROUND=BLACK font_size=3}
STYLE(TABLE)={JUST=C WIDTH=50%} LABEL;

LABEL ClientCad='ClientCad';
VAR MCI / STYLE(DATA)={JUST=C font_size=3} STYLE(HEADER)={BACKGROUND=GREY};
RUN;

ods html close;


%MEND EMAIL;

%EMAIL();

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Probably you want

 

%EMAIL

 

instead of 

 

%EMAIL();
--
Paige Miller

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

Probably you want

 

%EMAIL

 

instead of 

 

%EMAIL();
--
Paige Miller
Kurt_Bremser
Super User

Since your macro does not contain any macro elements which are valid only in a macro, you can run the code without the macro definition, which makes debugging easier.

Submit your code from the OPTIONS to the ODS HTML CLOSE statement, and post the log by copy/pasting the text into a window opened with this button:

Bildschirmfoto 2020-04-07 um 08.32.59.jpg

ChrisNZ
Tourmaline | Level 20
Probably you also want

%LET DTMVTFIM = %sysfunc(INTNX(MONTH1, %sysfunc(DATE()), &DT_INI., E));

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 3 replies
  • 910 views
  • 0 likes
  • 4 in conversation