COBOL ⭐ Featured
👁 0

Q: What are the four divisions of a COBOL program?

Answer:
  1. IDENTIFICATION DIVISION - Program identification (PROGRAM-ID)
  2. ENVIRONMENT DIVISION - Hardware/software environment, file assignments
  3. DATA DIVISION - Data definitions (FILE, WORKING-STORAGE, LINKAGE SECTION)
  4. PROCEDURE DIVISION - Executable code and business logic

Only IDENTIFICATION and PROCEDURE DIVISION are mandatory.

COBOL ⭐ Featured
👁 0

Q: Explain SECTION vs PARAGRAPH

Answer:
SECTION groups related paragraphs, terminated by next SECTION or end of program. PARAGRAPH is a named block of code, terminated by next paragraph/section. PERFORM SECTION executes all paragraphs within. SECTION needed for segmentation, PARAGRAPH for simple procedures.
DB2 ⭐ Featured
👁 0

Q: How to handle CLOB in COBOL?

Answer:
Declare: 01 CLOB-VAR SQL TYPE IS CLOB(1M). Or use LOB locator: 01 CLOB-LOC SQL TYPE IS CLOB_LOCATOR. FREE LOCATOR releases. DBMS_LOB procedures for manipulation. Large CLOBs need special handling.
COBOL ⭐ Featured
👁 0

Q: Explain PROCEDURE DIVISION USING

Answer:
PROCEDURE DIVISION USING defines parameters for called program. Parameters match LINKAGE SECTION definitions. Order matches calling program's USING clause. Establishes addressability to passed data. BY REFERENCE/VALUE/CONTENT options inherited from CALL.
COBOL ⭐ Featured
👁 0

Q: What is USE BEFORE REPORTING?

Answer:
In Report Writer, USE BEFORE REPORTING procedure runs before printing. USE BEFORE REPORTING report-group-name. Allows dynamic modification of report data. Can suppress or modify lines based on runtime conditions.
COBOL ⭐ Featured
👁 0

Q: Explain DEBUGGING declarative

Answer:
USE FOR DEBUGGING enables debug procedures. Requires WITH DEBUGGING MODE. Triggers on: ALTER, PERFORM, GO TO, or reference to debug item. Displays data values and flow. Object code excluded unless compiled with DEBUG option.
JCL ⭐ Featured
👁 0

Q: What is JCLLIB ORDER?

Answer:
JCLLIB ORDER specifies procedure library search order. //JOBNAME JOB ... // JCLLIB ORDER=(PROC.LIB1,PROC.LIB2). Searched for INCLUDE and EXEC procname. Takes precedence over JES2/3 proclibs. Must be before first EXEC statement.
DB2
👁 0

Q: What is stored procedure?

Answer:
Stored procedure is saved SQL code. CREATE PROCEDURE name(params) BEGIN SQL statements END. CALL name(values) executes. Can have IN/OUT/INOUT parameters. Reduces network traffic. Logic in database. Security benefits.
COBOL
👁 0

Q: What is SORT and MERGE in COBOL?

Answer:
SORT orders records: SORT SORT-FILE ON ASCENDING KEY-FIELD USING INPUT-FILE GIVING OUTPUT-FILE. INPUT/OUTPUT PROCEDURE allows processing during sort. MERGE combines pre-sorted files: MERGE SORT-FILE ON KEY USING FILE-1 FILE-2 GIVING OUTPUT-FILE.
COBOL
👁 0

Q: What is DECLARATIVES section?

Answer:
DECLARATIVES contains USE procedures for exception handling. USE AFTER ERROR PROCEDURE ON file-name handles file errors. USE AFTER EXCEPTION handles specific conditions. Must be first in PROCEDURE DIVISION. END DECLARATIVES marks end.
COBOL
👁 0

Q: What is PROCEDURE-POINTER?

Answer:
USAGE PROCEDURE-POINTER stores program addresses. SET proc-ptr TO ENTRY 'PROGNAME'. CALL proc-ptr. Enables dynamic program selection. Similar to function pointers. Used in table-driven designs. Check ADDRESS OF for validity.
JCL
👁 0

Q: What is EXEC PGM vs PROC?

Answer:
EXEC PGM=name executes program directly. EXEC procname or EXEC PROC=procname invokes cataloged procedure. EXEC name where 'name' exists as PROC takes precedence. Procedures can be overridden with PROC.STEP.DD syntax.
DB2
👁 0

Q: How to handle -818 SQLCODE?

Answer:
-818 is timestamp mismatch between plan and DBRM. DBRM precompiled after last BIND. Solutions: REBIND plan/package, ensure DBRM library current, check promotion procedures. Timestamp in DBRM must match bound plan.