The following is an example of a COBOL stub program calling a mainframe-hosted program:
The LOCALPROG is a COBOL program written in Enterprise Developer on a Windows machine. It invokes a program called MFPROG which is located on a mainframe. You can call the mainframe program with the ws-parm parameter. The parameter contains the string Calling mainframe program.
Once you have called the MFPROG, the Mainframe Call Generator feature sends a request and the parameter to the Mainframe Access Server. The mainframe COBOL program MFPROG can now access the parameter in the linkage section using the lk-parm. It moves the string My MFPROG into lk-parm and displays it before returning to the invoking program, LOCALPROG.
Control is returned to LOCALPROG which displays the value of ws-parm, which is now My MFPROG.