Dear SAS users,
I wrote the following:
%let Jahr = 2021 ; * Hier das Jahr einsetzten ;
%put &Jahr.;
%if &Jahr = 2021 %then %do;
%let Quelldatei="GESAMT_WTL_RKR"; %end.;
%else %do;
%let Quelldatei="GESAMT_JHR_RKR_&Jahr.";
%end;
and gets :
26 %let Jahr = 2021 ; * Hier das Jahr einsetzten ;
27 %put &Jahr.;
2021
28
29 %if &Jahr. = 2021 %then %do;
30 %let Quelldatei="GESAMT_WTL_RKR"; %end.;
30 %let Quelldatei="GESAMT_WTL_RKR"; %end.;
_
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
WARNING: Apparent invocation of macro END not resolved.
ERROR: The %ELSE statement is not valid in open code.
31 %else %do;
32 %let Quelldatei="GESAMT_JHR_RKR_&Jahr.";
33 %end;
how can I correct this?
regards