21⟩ How to execute a set of JCL statements from a COBOL program?
Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.
“Cobol Interview Questions and Answers will guide us now that COBOL is one of the oldest programming languages in computer history. COBOL name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. Learn COBOL programming basic and advance concepts or get preparation of COBOL based jobs interview by our this Cobol Interview Questions and Answers Guide.”
Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.
The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA.
The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program.
The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored
Indexing uses binary displacement. Subscripts use the value of the occurrence.
When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL.
In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster.
Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library.
The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.
Before IBM introduced MVS/XA architecture in the 1980’s a program’s virtual storage was limited to 16 Megs. Programs compiled with a 24 bit mode can only address 16 Mb of space, as though they were kept under an imaginary storage line. With COBOL II a program compiled with a 31 bit mode can be ‘above the 16 Mb line. (This ‘below the line’, ‘above the line’ imagery confuses most mainframe programmers, who tend to be a literal minded group.)
Partial list: REMARKS, NOMINAL KEY, PAGE-COUNTER, CURRENT-DAY, TIME-OF-DAY, STATE, FLOW, COUNT, EXAMINE, EXHIBIT, READY TRACE and RESET TRACE.
The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.
The editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.
The linkage section is part of a called program that ‘links’ or maps to data items in the calling program are working storage. It is the part of the called program where these share items are defined.
Wake up - you haven’t been paying attention! It is not possible to pass an index via linkage. The index is not part of the calling programs working storage. Those of us, who’ve made this mistake, appreciate the lesson more than others.
A subscript is a working storage data definition item, typically a PIC (999) where a value must be moved to the subscript and then incremented or decrements by ADD TO and SUBTRACT FROM statements. An index is a register item that exists outside the program’s working storage. You SET an index to a value and SET it UP BY value and DOWN BY value.
An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax’s: 1.) USING, GIVING sorts are comparable to external sorts with no extra file processing; 2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.
In COBOL II the optional clause WITH TEST BEFORE or WITH TEST AFTER can be added to all perform statements. By default the test is performed before the perform.
Scope terminators are mandatory for in-line PERFORMS and EVALUATE statements. For readability, it is recommended coding practice to always make scope terminators explicit.
Absolutely. Evaluation of the WHEN clauses proceeds from top to bottom and their sequence can determine results.