PUSH AND POP COMMANDS - IBM Mainframe

The PUSH and POP commands are used to suspend and reactivate respectively, all HANDLE CONDITION requests currently in effect. These are useful while performing a subroutine embedded in a main program. A called routine can use the PUSH command to suspend the existing HANDLE CONDITION, whereas before returning control to the caller a POP command can be issued to reactivate the HANDLE CONDITIONS. Also the PUSH and POP commands can be used to suspend and reactivate the HANDLE AID command and HANDLE ABEND commands. The syntax of the PUSH and POP commands are as follows:

PUSH AND POP COMMANDS

The program will work as follows. When the program calls the subroutine A all the HANDLE CONDITIONS in effect in the main program will be suspended by the PUSH HANDLE command. Then the next HANDLE CONDITION that is in the subroutine is limited to the subroutine. At the completion of the subroutine the POP HANDLE command will reactivate all the HANDLE CONDITIONS that have been suspended in the subroutine. In this way the HANDLE CONDITION requests specified in the main program can be independent of those in the subroutines.

Even if the PUSH and POP commands are issued in the subroutines the conditions established in the HANDLE CONDITION command in the subroutine will be active in the main program after control is returned. In order to avoid this a HANDLE CONDITION command without any paragraph names should be specified in the subroutine. Thus the SUBROUTINE-A should be coded as follows to avoid the effects of the HANDLE CONDITION issued in it in the main program.

HANDLE CONDITION issued in it in the main program

HANDLE CONDITION issued in it in the main program


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

IBM Mainframe Topics