Problem:
Is the following syntax in Macros no Longer supported? The following Fails:
% IF NOT &DEFINED( &SEQ-NBR)
% &SEQ-NBR = ZERO
When we change the ZERO to o it works:
% IF NOT &DEFINED( &SEQ-NBR)
% &SEQ-NBR = 0
Resolution:
The condition of the IF is not actually being executed on the mainframe so the code with the ZERO is actually not getting executed. In AMB, all macro language is being checked for correct syntax, even if that code is under an IF statement and not executed at compile time. In my mainframe testing, if I isolate the % &SQL-NBR = ZERO to a line by it's self, not under an IF, then I get an error. The statement with ZERO is actually incorrect coding syntax on the mainframe as well as on the PC. But in this case on the mainframe, because it is under an IF statement, the mainframe does not flag the syntax error.
Consider this macro below. When called on the mainframe, I get one error message on the SECOND statement with the ZERO. The first ZERO under the IF does not get flagged as an error. If I change second ZERO to 0, I get a clean generate. I believe this means the syntax with the ZERO is actually incorrect but was not being flagged in the older mainframe macro generator because it is under the IF.
% DEFINE $ZERO1
% IF NOT &DEFINED(&SEQ-NBR)
% &SEQ-NBR = ZERO
% &SEQ-NBR = ZERO
% END
#MFDS
#EnterpriseDeveloper