dear SAS experts,
I need to write a simple macro to calculate:
- the current date
- the day before the current date
and use them afterwards in the programm.
I wrote:
/* macro-code fuer den Auswertungstag */
%macro auswert;
%global Date_of_today;
%let Date_of_today=%sysfunc(today());
%mend auswert;
%auswert;
%put &Date_of_today.;
%macro Auswertungstag;
Auswertungstag=&Date_of_today.-1;
%mend Auswertungstag;
%Auswertungstag;
/* Der Monatszeitraum fängt an, mit dem Vormonat von dem Auswertungstag */
%put &Auswertungstag.;
but I have this error message in the log:
/* macro-code fuer den Auswertungstag */
27 %macro auswert;
28 %global Date_of_today;
29 %let Date_of_today=%sysfunc(today());
30 %mend auswert;
31 %auswert;
32 %put &Date_of_today.;
21930
33
34 %macro Auswertungstag;
35 Auswertungstag=&Date_of_today.-1;
36 %mend Auswertungstag;
37 %Auswertungstag;
NOTE: Line generated by the invoked macro "AUSWERTUNGSTAG".
37 Auswertungstag=&Date_of_today.-1;
______________
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
38
39 %put &Auswertungstag.;
WARNING: Apparent symbolic reference AUSWERTUNGSTAG not resolved.
&Auswertungstag.
what do I do wrong?
can someone send me the correct script?
thanks a lot for any help
regards
PY