Terminates execution of an external subroutine and returns control to a statement following the [ ] command that called the subroutine.
RTN{n}
n specifies that control should be returned to the n'th statement line after the calling [ ] command. Can be a number, or a direct or indirect reference to a buffer or select register.
If n is not specified, control will return to the statement immediately following the calling [ ] command.
A RTN without a corresponding [ ] command will terminate the program.
| MENU | MENU2 |
| . | . |
| 051 [SUBS MENU2] | 066 RTN |
| 052 ... | |
| 053 ... |
jCL program MENU calls MENU2 from line 51. When MENU2 reaches line 66, control will be returned to MENU at line 52.
| MENU | MENU2 |
| . | . |
| 051 [SUBS MENU2] | 066 RTN 2 |
| 052 ... | |
| 053 ... |
jCL program MENU calls MENU2 from line 51. When MENU2 reaches line 66, control will be returned to MENU at line 53.
JCL