COBOL programs and non-COBOL programs can call and be called by PL/I, FORTRAN, and assembler language programs. From your point of view as a COBOL programmer, the coding is the same when you call a program written in another language as when you call another COBOL program.
If your COBOL program is calling, use a CALL statement with a USING phrase that points to the items that will constitute the parameter list. Control is returned to your program at the next statement after the CALL (unless the called program or any program called by it terminates the run unit).
If your COBOL program is being called with parameters, you need a USING phrase on the PROCEDURE DIVISION statement, and a Linkage Section that describes the parameters to be received. Your program can return control with a GOBACK statement (or it can terminate the run unit with a STOP RUN statement). One consideration for you, as a COBOL programmer, is the matching of the parameter lists. If your program is calling a non-COBOL program or service, you must understand what it expects in the way of input, and set up your data items accordingly. If your program is being called, you must know what will be passed, and set up your Linkage Section to accept it. Another consideration for you, as a COBOL programmer, is the treatment of the RETURN-CODE special register. If the called program is a non-COBOL program and does not use register 15 as a return code when returning, then the calling COBOL program's RETURN-CODE special register may be updated with an invalid value. When the RETURN-CODE special register contains an invalid value, it is recommended that you set the RETURN-CODE special register to a meaningful value before your COBOL program returns control to the operating system. Otherwise, an invalid return code will be passed back to the system.
Dynamic calls to the same non-COBOL program using alternative entry points or alias names require the called program to be link-edited with either the RENT or REUS link-edit attributes. When COBOL and non-COBOL programs are to be executed together in a single run unit, the following considerations apply:
COBOL does not permit calling a program that has been called already, but has not yet terminated (that is, executed a COBOL statement or a CICS command for normal termination). It is, therefore, not valid to recall such an active program after an abend has occurred. However, a run unit that has terminated abnormally may be called again, as long as the run-time option NOSTAE has not been specified.
To execute properly, the abend interception mechanism of the non-COBOL program must be ESTAE to be compatible with COBOL. If it is not, unpredictable results may occur in the event of an abend. Also, an abend may result. If a VS COBOL II subprogram is loaded and deleted by a non-COBOL program while the run unit executes, then the COBOL subprogram must be reentrant.
A COBOL program that is dynamically loaded and invoked by a non-COBOL program is treated differently than if it were dynamically called by COBOL. In this case, if the COBOL subprogram was compiled with the REENTRANT option and is also dynamically called by another COBOL program, a separate working storage area is acquired. The program's last-used state will depend on how it. was called. In addition, the COBOL run-time environment will not delete the subprogram at run unit termination.
A non-COBOL program should not invoke a COBOL main program more than once, unless the COBOL program is in initial state when entered. The COBOL main program is in initial state when entered under these circumstances:
Multiple run units within the same task are supported by VS COBOL II, as long as all the COBOL programs are compiled with the RESIDENT compiler option. The first run unit within a task starts when the first COBOL program is initialized. A new run unit starts with the first program executed after a LINK. The first COBOL program in each run unit is a main program, unless a reusable run-time environment has been created. When a reusable run-time has been created, the first COBOL program in the first run unit only is treated as a subprogram.
Multiple tasks within the same region are supported for RESIDENT run units only under C1CS. Multiple OS tasks within the same region are not supported by COBOL in conjunction with the Library Management feature (RES option). COBOL does not preclude multitasking if the run units are compiled with NORES. However, any restrictions and conventions of multitasking imposed by the operating system, access methods, and so on, must be observed.
IBM Mainframe Related Interview Questions
|IBM Lotus Notes Interview Questions||IBM-CICS Interview Questions|
|COBOL Interview Questions||Linux Interview Questions|
|IBM-JCL Interview Questions||IBM Mainframe Interview Questions|
|IBM AIX Interview Questions||IBM WAS Administration Interview Questions|
|IBM Lotus Domino Interview Questions||IBM Integration Bus Interview Questions|
|Mainframe DB2 Interview Questions||Unix Production Support Interview Questions|
Ibm Mainframe Tutorial
Introduction To Software Development
Introduction To Ibm Mainframes
Tso And Ispf
Jes2, ]es3 And Sms
Introduction To Job Control Language (jcl)
The Job Statement
The Exec Statement
The Job And Exec Statements
The Dd Statement
Procedures And Symbolic Parameters
Generation Data Groups (gdg), Compile/link-edit And Run Jcls
Access Method Services (ams)
Additional Vsam Commands
Introduction To Rexx
Overview Of Rexx
Introduction To Cics
Exception Handling In Cics
Developing A Cics Application
Cics Programming Techniques
Basic Mapping Support (bms)
Transient Data Control
Temporary Storage Control
Interval And Task Control
Cics Application Design
Recovery And Restart
System Security And Intersystem Communication
Cics Debugging Facilities And Techniques
Bms Map Definition Macros And Copylib Members
Cics Response And Abend Codes
Data, Information And Information Processing
Introduction To Database Management Systems
Introduction To Relational Database Management Systems
Database Architecture And Data Modeling
Overview Of Db2
Structured Query Language (sql)
Data Security And Access
Db2 Application Development
Qmf And Db2i
Db2 Performance Monitoring, Utilities And Recovery/restart
Overview Of Information Management System (ims)
Introduction To Vs Cobol Ii
Overview Of Application Development In Vs Cobol Ii
Overview Of The Cobol Program
Sorting And Merging Files
Coding Cobol Programs That Run Under Cics. Ims, Db2 And Ispf
Compiling The Program
Link-editing The Program
Executing The Program
Improving Program Performance
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.