AMB stores all EPILOGUE rule calls in an EPILOGUE queue, and invokes them in "last in, first called" order. Assuming that you code the EPILOGUE statement in the Procedure Division, AMB places the invoked rules at the end of the Procedure Division. You can override the "last in, first called" rule by following the last % SET EPILOGUE statement with an empty % SET EPILOGUE statement-- AMB gets the rule name value from &APS-EPILOGUE.
Store three rule calls in the EPILOGUE queue, but invoke just $RULE-1.
% SET EPILOGUE $RULE-1 % SET EPILOGUE $RULE-2 % SET EPILOGUE $RULE-3 %* Current value of &APS-EPILOGUE is $RULE-3. . % SET EPILOGUE %* $RULE-3 (the current value of &APS-EPILOGUE) is %* eliminated from the EPILOGUE queue; %* the new current value of &APS-EPILOGUE is $RULE-2. . % SET EPILOGUE %* $RULE-2 (the current value of &APS-EPILOGUE) is %* eliminated from the EPILOGUE queue; %* the new current value of &APS-EPILOGUE is $RULE-1. %* $RULE-1 (the current value of &APS-EPILOGUE) is %* invoked.
Comments:
The results of calling AMB rules in an EPILOGUE rule can be unpredictable. We recommend that you call only user-defined rules from an EPILOGUE rule.