Executes a subroutine in the local program or in the main program.
EXSR
Sr (Subroutine Name)
ParmList (*NONE | Parameter Name List)
Required. Specifies the name of the subroutine. If the subroutine name specified is defined in the current program, the current program's subroutine will be called. Otherwise, if a subroutine is found in the main program, the main program's subroutine will be called.
Optional. Allows you to declare parameters by specifying the name of a parameter list. The default is *NONE. You can also define parameters as noted in the paragraph below.
If the subroutine has parameters (declared by using the DCLSRPARM command after the BEGSR command), you must pass the correct number of parameters by using the DCLPARM commands after the EXSR. See DCLPARM for an example of this.
DoWhile *In03 = *Off
Exfmt frmListName
Select
When Option = Add
Exsr AddRecord
When Option = Delete
Exsr DeleteRecord
Endsl
Enddo
BEGSR
CAB
DCLSRPARM
DOUNTIL
DOWHILE
IF
WHEN
Comparison Operators