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();
Probably you want
%EMAIL
instead of
%EMAIL();
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:
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.
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.
Ready to level-up your skills? Choose your own adventure.