COBOL ⭐ Featured
👁 0

Q: What is a copybook and why is it used?

Answer:

A copybook is a reusable code file that can be included in multiple programs using the COPY statement.

Uses:

  • Standard record layouts
  • Common working storage definitions
  • Reusable paragraphs
  • Ensures consistency across programs

Syntax:

COPY EMPREC.
COPY EMPREC REPLACING ==EMP== BY ==WS-EMP==.

Benefits:

  • Reduces code duplication
  • Easier maintenance
  • Standard definitions across team
DB2 ⭐ Featured
👁 0

Q: What is RECOVER utility?

Answer:
RECOVER restores data from backup/logs. RECOVER TABLESPACE db.ts. Options: TOCOPY, TORBA, TOLOGPOINT. Image copy is backup. RECOVER applies logs to copy. Essential for disaster recovery.
DB2 ⭐ Featured
👁 0

Q: How to create image copy?

Answer:
COPY utility creates backup. COPY TABLESPACE db.ts. FULL or INCREMENTAL. SHRLEVEL REFERENCE or CHANGE. Store in GDG for versions. Regular copies essential for recovery. COPYTOCOPY duplicates copies.
DB2 ⭐ Featured
👁 0

Q: How to handle restrictive states?

Answer:
COPY PENDING needs image copy. CHECK PENDING needs CHECK DATA. REBUILD PENDING needs REBUILD INDEX. REORG PENDING needs REORG. RECOVER PENDING needs RECOVER. Use -DISPLAY DATABASE to see status.
DB2 ⭐ Featured
👁 0

Q: What is tablespace?

Answer:
Tablespace is storage container for tables. CREATE TABLESPACE name IN database USING STOGROUP. Contains one or more tables. Segmented/universal tablespace types. Management at tablespace level (REORG, COPY, RECOVER).
COBOL ⭐ Featured
👁 0

Q: What is LOCAL-STORAGE SECTION?

Answer:
LOCAL-STORAGE SECTION is reinitialized each invocation. Unlike WORKING-STORAGE which retains values. Each thread gets own copy. Useful for recursive programs and threaded environments. COBOL-85+ feature. Not all compilers support equally.
COBOL ⭐ Featured
👁 0

Q: Explain COPY REPLACING

Answer:
COPY copybook REPLACING ==:TAG:== BY ==WS-==. Substitutes text during copy. Pseudo-text delimiters ==. Can replace identifiers, literals, words. Multiple REPLACING clauses allowed. Useful for generic copybooks.
JCL ⭐ Featured
👁 0

Q: What is IEBGENER utility?

Answer:
IEBGENER copies sequential datasets. SYSUT1=input, SYSUT2=output, SYSIN=control. Simple copy needs only SYSUT1/SYSUT2/SYSIN DD DUMMY. Can reformat, generate, edit records with SYSIN statements. Being replaced by ICEGENER.
CICS ⭐ Featured
👁 0

Q: What is BMS?

Answer:
BMS (Basic Mapping Support) handles screen I/O. Map defines screen layout. DFHMSD macro creates mapset. SEND MAP displays screen. RECEIVE MAP gets input. Symbolic map in COBOL copybook. Physical map in load library.
JCL ⭐ Featured
👁 0

Q: How to reference PDS member?

Answer:
DSN=PDS.NAME(MEMBER). Direct member reference. DISP must allow access. For input, member must exist. For output, overwrites or creates. IEBCOPY for multiple members. Member name 1-8 characters.
CICS ⭐ Featured
👁 0

Q: Explain symbolic map structure

Answer:
Symbolic map copybook. Field name with L (length), F (flag), A (attribute), I (input), O (output). Set -1 in length for cursor. Check flag for modified. Program data area.
DB2
👁 0

Q: What is DCLGEN?

Answer:
DCLGEN generates COBOL declarations from table. DCLGEN TABLE(name) LIBRARY(dataset) STRUCTURE(host-struct-name). Creates copybook with field definitions. Essential for maintaining table-program consistency.
DB2
👁 0

Q: Explain LOAD utility

Answer:
LOAD inserts large data volumes. LOAD DATA INTO TABLE name. Options: REPLACE, RESUME, LOG NO. Input is SYSREC dataset. LOAD faster than INSERT. Puts tablespace in COPY PENDING after LOG NO.
COBOL
👁 0

Q: What is the purpose of COPY statement?

Answer:
COPY includes copybook members at compile time, promoting code reuse and standardization. Syntax: COPY copybook-name. REPLACING clause allows field substitution. Copybooks typically contain record layouts, working-storage definitions, and common routines.
COBOL
👁 0

Q: Explain CALL statement and parameters

Answer:
CALL invokes subprogram: CALL 'SUBPROG' USING param-1 param-2. BY REFERENCE (default) passes address. BY CONTENT passes copy. BY VALUE passes value (for C). ON EXCEPTION handles load failures. CANCEL releases memory.
VSAM
👁 0

Q: What is REPRO utility?

Answer:
REPRO copies VSAM files. IDCAMS REPRO INFILE(in) OUTFILE(out). Can REPRO between VSAM and sequential. Options: FROMKEY/TOKEY, SKIP/COUNT, REPLACE. Used for backup, conversion, extraction.
COBOL
👁 0

Q: What is REPLACE statement?

Answer:
REPLACE substitutes text during compilation. REPLACE ==OLD-TEXT== BY ==NEW-TEXT==. Active until REPLACE OFF or next REPLACE. Useful with copybooks for site-specific modifications. Different from COPY REPLACING-more global.
VSAM
👁 0

Q: Explain EXPORT utility

Answer:
EXPORT creates portable copy with catalog info. IDCAMS EXPORT ds.name OUTFILE(dd). Includes cluster definition. IMPORT recreates on target system. Good for migration.
VSAM
👁 0

Q: What is DEFINE MODEL?

Answer:
MODEL copies attributes from existing cluster. DEFINE CLUSTER(NAME(new) MODEL(existing)). Only copies definition, not data. Useful for creating similar clusters. Can override specific parameters.
JCL
👁 0

Q: What is TYPRUN parameter?

Answer:
TYPRUN options: SCAN (syntax check, no execution), HOLD (submit but hold), COPY (copy JCL to SYSOUT), JCLHOLD (hold with JCL). TYPRUN=SCAN validates JCL without running. Useful for testing complex JCL before production.
JCL
👁 0

Q: How does IEBCOPY work?

Answer:
IEBCOPY copies/merges PDS members. SYSUT1=input PDS, SYSUT2=output PDS. SYSIN: COPY OUTDD=SYSUT2,INDD=SYSUT1 copies all. SELECT MEMBER=name for specific members. REPLACE option overwrites existing. Can compress PDS.
VSAM
👁 0

Q: What is REPLICATE option?

Answer:
REPLICATE duplicates sequence set on each track. Each track has own copy of sequence set index. Reduces contention. Obsolete with modern systems. Uses more space.
VSAM
👁 0

Q: What is BDAM conversion to VSAM?

Answer:
BDAM is block-oriented, VSAM is record-oriented. Convert: analyze BDAM access, choose KSDS/RRDS/ESDS. REPRO or IDCAMS copy. Program changes for VSAM access. Test thoroughly.