What are the steps you go through while creating a COBOL program executable?
Correct Answer
DB2 precompiler (if embedded sql used), CICS translator (if CICS program), COBOL compiler, Link editor If DB2 program, create plan by binding the DBRMs
Technology problems
Search Results
1. How do you sort in a COBOL program? Give sort file definition, sort statement syntax and meaning.
Correct Answer: Syntax: SORT file-1 ON ASCENDING/DESCENDING KEY key USING file-2 GIVING file-3 USING can be substituted by INPUT PROCEDURE IS para-1 THRU para-2 GIVING can be substituted by OUTPUT PROCEDURE IS para-1 THRU para-2 file-1 is the sort workfile and must be described using SD entry in FILE SECTION file-2 is the input file for the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL file-3 is the outfile from the SORT and must be described using an FD entry in FILE SECTION and SELECT clause in FILE CONTROL file-1, file-2 & file-3 should not be opened explicitly INPUT PROCEDURE is executed before the sort and records must be RELEASEd to the sort work file from the input procedure OUTPUT PROCEDURE is executed after all records have been sorted Records from the sort work file must be RETURNed one at a time to the output procedure
2. What are different file OPEN modes available in COBOL?
Correct Answer: Open for INPUT, OUTPUT, I-O, EXTEND 1INPUT : for read only purpose 2OUTPUT : for write only purpose 3EXTEND : for appending records 4I-O : for read and write(using EXTEND) purpose
3. How do you define a sort file in JCL that runs the COBOL program?
Correct Answer: Use the SORTWK01, SORTWK02, dd names in the step Number of sort datasets depends on the volume of data being sorted, but a minimum of 3 is required
4. Specify the CICS command used to read a VSAM record starting with prefix F. Code all the relevant options?
Correct Answer: There are some differences: COBOL II supports structured programming by using in line Performs and explicit scope terminators It introduces new features (EVALUATE, SET TO TRUE, CALL BY CONTEXT, etc) It permits programs to be loaded and addressed above the 16-megabyte line It does not support many old features (READY TRACE, REPORT-WRITER, ISAM, etc) It offers enhanced CICS support
10. What guidelines should be followed to write a structured COBOL program ?
Correct Answer: Following guidelines to be following while writing Cobol program: - Use ? EVALUATE ? statement for constructing cases - Use scope terminators for nesting - Use in-line Perform statement for writing ?do? constructions - Use Test Before and Test After in the Perform statement while writing Do-While statements