COBOL S0C7 ⭐ Featured
👁 0

Q: How do I fix S0C7 Data Exception ABEND?

Answer:

S0C7 occurs when the program tries to perform arithmetic on non-numeric data.

Common Causes:

  1. Uninitialized numeric fields (contains spaces/garbage)
  2. Moving alphanumeric data to numeric field
  3. Reading file with wrong record layout
  4. Array subscript accessing wrong memory

How to Fix:

  1. Initialize all numeric fields to ZEROS
  2. Validate input before arithmetic
  3. Check file layouts match
  4. Use DISPLAY to debug field contents
* Always initialize
INITIALIZE WS-RECORD.
MOVE ZEROS TO WS-AMOUNT.

* Validate before use
IF WS-INPUT IS NUMERIC
    COMPUTE WS-RESULT = WS-INPUT * 2
END-IF.
DB2 ⭐ Featured
👁 0

Q: What is CTE (Common Table Expression)?

Answer:
CTE defines temporary result set. WITH cte_name AS (SELECT...) SELECT * FROM cte_name. Improves readability. Can be recursive for hierarchies. Multiple CTEs comma-separated. Referenced in main query. Scope is single statement.
JCL ⭐ Featured
👁 0

Q: What is the difference between PARM and SYSIN for passing parameters?

Answer:

PARM (EXEC statement):

  • Limited to 100 characters
  • Passed in memory to program
  • Accessed via LINKAGE SECTION
  • Good for small, simple parameters

SYSIN (DD statement):

  • No practical size limit
  • Read as a file by program
  • Can contain multiple records
  • Good for control cards, complex input
// PARM example
//STEP1 EXEC PGM=MYPROG,PARM='PARAM1,PARAM2'

// SYSIN example
//SYSIN DD *
CONTROL OPTION1
DATE=20231215
LIMIT=1000
/*
COBOL ⭐ Featured
👁 0

Q: What is 88-level condition name?

Answer:
88-level defines condition names for field values. 01 WS-STATUS PIC X. 88 VALID-STATUS VALUE 'Y'. 88 INVALID-STATUS VALUE 'N'. Use in IF: IF VALID-STATUS. Set using SET VALID-STATUS TO TRUE. Makes code self-documenting.
COBOL ⭐ Featured
👁 0

Q: Explain START statement for VSAM

Answer:
START positions for sequential READ. START filename KEY IS EQUAL/GREATER/NOT LESS THAN key-field. After successful START, READ NEXT retrieves records sequentially from that position. INVALID KEY handles not-found condition.
COBOL ⭐ Featured
👁 0

Q: What is SAME RECORD AREA?

Answer:
SAME RECORD AREA clause specifies files share buffer: SAME RECORD AREA FOR FILE-1 FILE-2. Records of different files occupy same memory. Reading one file overlays other's record. Saves memory but requires careful coding.
VSAM ⭐ Featured
👁 0

Q: Explain SHAREOPTIONS parameter

Answer:
SHAREOPTIONS(crossregion,crosssystem). Values: 1=exclusive, 2=read share/write exclusive, 3=full sharing, 4=full sharing no buffer refresh. SHAREOPTIONS(2 3) is common. Higher sharing needs application coordination.
VSAM ⭐ Featured
👁 0

Q: How to handle file status 23?

Answer:
Status 23 is record not found for random READ or START. Key doesn't exist. Check key value, spelling. May be legitimate (check if exists logic). START with EQUAL, GTEQ, LTEQ options.
VSAM ⭐ Featured
👁 0

Q: What causes file status 48?

Answer:
Status 48 is OPEN failure, file already open. Check logic - may have duplicate OPEN. CLOSE before re-OPEN. COBOL FILE-STATUS check important. May be another job has exclusive access.
VSAM ⭐ Featured
👁 0

Q: What is file status 92?

Answer:
Status 92 is logic error. Conflicting operation for file state. Examples: READ before OPEN, WRITE to INPUT file, wrong ACCESS MODE for operation. Check program logic carefully.
COBOL ⭐ Featured
👁 0

Q: What is READY TRACE?

Answer:
READY TRACE turns on paragraph tracing. Shows paragraph names as executed. RESET TRACE turns off. Must compile with debugging option. Output goes to SYSOUT. Replaced by better debuggers but useful for quick flow analysis.
COBOL ⭐ Featured
👁 0

Q: Explain SYMBOLIC CHARACTERS

Answer:
SPECIAL-NAMES. SYMBOLIC CHARACTERS NULL-CHAR IS 1. Assigns name to ordinal position in collating sequence. Position 1 is X'00' in EBCDIC. Use: MOVE NULL-CHAR TO field. Define non-printable characters readably.
VSAM ⭐ Featured
👁 0

Q: How to access RRDS?

Answer:
ACCESS MODE IS RANDOM. Use RELATIVE KEY for slot number. READ/WRITE by slot. STATUS 23 if slot empty. Can have empty slots. Record size fixed for RRDS.
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: What is EXEC CICS structure?

Answer:
EXEC CICS marks CICS commands. EXEC CICS READ FILE('name') INTO(area) RIDFLD(key) END-EXEC. Commands: READ, WRITE, SEND, RECEIVE, LINK, XCTL. RESP and RESP2 capture return codes. Translator converts to CALL.
VSAM ⭐ Featured
👁 0

Q: How to update KSDS record?

Answer:
READ record (optionally FOR UPDATE). Modify record area. REWRITE record. Key cannot change on REWRITE. Status 00 if successful. ACCESS MODE must allow updates.
VSAM ⭐ Featured
👁 0

Q: How to handle variable length KSDS?

Answer:
Define with RECORDSIZE(avg max). Read/write variable length records. COBOL RECORD VARYING clause. Key position fixed. Read returns actual length. Write length implicit from record.
VSAM ⭐ Featured
👁 0

Q: How to compress VSAM?

Answer:
DFSMS compression via DATACLAS. Or EXTENDED FORMAT with compression. Not native VSAM feature. Reduces space, adds CPU overhead. Good for large, read-heavy files.
VSAM ⭐ Featured
👁 0

Q: What is file status 41?

Answer:
Status 41 is file already open. Duplicate OPEN attempted. Check program flow. CLOSE before re-OPEN. May be logic error in nested calls. STATUS after OPEN shows this.
JCL ⭐ Featured
👁 0

Q: What is the difference between COND and IF/THEN/ELSE?

Answer:
COND tests return codes to skip steps (negative logic - skips IF true). IF/THEN/ELSE tests conditions to execute steps (positive logic). IF supports complex expressions, COND is simpler but confusing. IF preferred for readability. COND on JOB affects all steps; on EXEC affects that step.
VSAM ⭐ Featured
👁 0

Q: Explain NONUNIQUEKEY?

Answer:
AIX can have NONUNIQUEKEY (duplicates). Base cluster KSDS always unique primary key. NONUNIQUEKEY AIX returns first match, use READ NEXT for others. UNIQUEKEY if one-to-one.
VSAM ⭐ Featured
👁 0

Q: What is backward READ?

Answer:
READ PREVIOUS for backward sequential. Must establish position first (START or READ). KSDS and ESDS support backward. Useful for end-of-file processing or range searches.
JCL ⭐ Featured
👁 0

Q: How to concatenate datasets?

Answer:
Stack DD statements: //INPUT DD DSN=FILE1,DISP=SHR // DD DSN=FILE2,DISP=SHR. No DD name on continuation. Read consecutively as one file. Different LRECL needs LRECL on first DD or DCB parameter. Concatenation limit varies by system.
VSAM ⭐ Featured
👁 0

Q: What is FREESPACE distribution?

Answer:
FREESPACE spread across CIs and CAs. Initial load distributes evenly. After activity, distribution varies. REORG restores even distribution. Monitor CI/CA splits for tuning.
CICS ⭐ Featured
👁 0

Q: What is EXEC CICS READ?

Answer:
READ retrieves VSAM record. EXEC CICS READ FILE(name) INTO(area) RIDFLD(key) LENGTH(len). Optionally: UPDATE for update intent, KEYLENGTH for partial key. Generic key with GENERIC/KEYLENGTH. Returns NOTFND if missing.
CICS ⭐ Featured
👁 0

Q: How to use temporary storage?

Answer:
TS queue stores data across tasks. EXEC CICS WRITEQ TS QUEUE(name) FROM(data). READQ retrieves. DELETEQ removes. ITEM number for multiple items. MAIN/AUXILIARY for storage type. Named by string.
CICS ⭐ Featured
👁 0

Q: How to do file BROWSE?

Answer:
BROWSE reads sequentially. EXEC CICS STARTBR FILE(name) RIDFLD(key). READNEXT/READPREV in loop. ENDBR ends browse. TOKEN for concurrent browses. Can use generic key to position.
CICS ⭐ Featured
👁 0

Q: Explain ASKTIME/FORMATTIME

Answer:
ASKTIME gets current time. EXEC CICS ASKTIME ABSTIME(ws-abstime). FORMATTIME converts to readable. FORMATTIME ABSTIME(ws-abstime) DATESEP('/') TIMESEP(':'). Formatting options available.
CICS ⭐ Featured
👁 0

Q: What is LENGTH in commands?

Answer:
LENGTH specifies data size. LENGTH(ws-len). Required for variable data. Set before RECEIVE. Check after READ for actual length. FLENGTH for fullword. Some commands have defaults.
CICS ⭐ Featured
👁 0

Q: What is KEYLENGTH option?

Answer:
KEYLENGTH specifies key portion for generic access. EXEC CICS READ FILE RIDFLD(partial) KEYLENGTH(4) GENERIC. Finds first matching prefix. Use with GTEQ for range.
JCL ⭐ Featured
👁 0

Q: What is SYSIN DD *?

Answer:
SYSIN DD * starts instream data. Data follows until /*. Program reads via SYSIN DD. Common for utility control statements. DD DATA,DLM=xx if data contains /*. SYSIN DD DUMMY for no input.
CICS ⭐ Featured
👁 0

Q: What is DFHRESP?

Answer:
DFHRESP macro converts response name. DFHRESP(NOTFND) returns numeric value. Use in IF: IF ws-resp = DFHRESP(NORMAL). Readable condition checking. Standard practice.
DB2 ⭐ Featured
👁 0

Q: What is DB2 catalog?

Answer:
Catalog tables describe DB2 objects. SYSIBM.SYSTABLES for tables, SYSIBM.SYSCOLUMNS for columns, SYSIBM.SYSINDEXES for indexes. Query catalog for metadata. Read-only except through DDL. Essential for documentation and analysis.
CICS ⭐ Featured
👁 0

Q: Explain CICS DB2 connection

Answer:
CICS connects to DB2 via thread. EXEC SQL in CICS program. RCT (Resource Control Table) defines. Thread pool for efficiency. DB2 subsystem parameter.
DB2 ⭐ Featured
👁 0

Q: Explain DB2 locking

Answer:
DB2 locks at row, page, table, tablespace level. X (Exclusive) for writes, S (Share) for reads. IX/IS for intent. Lock escalation moves to higher level. LOCK TABLE statement forces mode. Timeout if wait too long.
COBOL
👁 0

Q: What is EVALUATE statement and when to use it?

Answer:
EVALUATE is COBOL's case/switch construct. Syntax: EVALUATE TRUE WHEN condition-1 statement WHEN OTHER default END-EVALUATE. More readable than nested IF for multiple conditions. Can evaluate multiple subjects and use THRU for ranges.
DB2
👁 0

Q: What is table compression?

Answer:
Compression reduces storage. Huffman encoding in dictionary. CREATE TABLE ... COMPRESS YES. REORG to compress existing. CPU trade-off for I/O savings. Good for read-heavy, large tables.
COBOL
👁 0

Q: What is FILE STATUS and common codes?

Answer:
FILE STATUS is a 2-byte field capturing I/O operation results. 00=success, 10=end-of-file, 22=duplicate key, 23=record not found, 35=file not found, 39=file attribute mismatch, 41=file already open, 47=not opened input. Essential for error handling.
COBOL
👁 0

Q: How does ACCEPT and DISPLAY work?

Answer:
ACCEPT reads from console/system: ACCEPT WS-DATE FROM DATE, ACCEPT WS-INPUT FROM CONSOLE. DISPLAY writes to console: DISPLAY 'Message' WS-FIELD. UPON clause specifies destination. Limited in batch; mainly for debugging or simple interaction.
DB2
👁 0

Q: Explain thread management

Answer:
Thread is DB2 connection. Allied thread for TSO/batch. DBAT (database access thread) for DDF. Pool thread for efficient reuse. Max threads controlled by zparm. Monitor active threads.
COBOL
👁 0

Q: Explain BLANK WHEN ZERO clause

Answer:
BLANK WHEN ZERO displays spaces when numeric field contains zero. 05 WS-AMOUNT PIC Z(5)9.99 BLANK WHEN ZERO. Shows blank instead of 0.00. Only for numeric-edited or numeric display fields. Improves report readability.
VSAM
👁 0

Q: How to read VSAM sequentially?

Answer:
OPEN INPUT file. START if positioning needed. READ NEXT repeatedly until status 10 (end of file). CLOSE file. START optional - defaults to beginning. READ NEXT gets records in key sequence for KSDS.
COBOL
👁 0

Q: What is OPEN mode options?

Answer:
OPEN INPUT for read, OUTPUT for write (creates), I-O for read/update, EXTEND for append. Multiple files per OPEN. OPEN OUTPUT deletes existing file! EXTEND preserves and adds. File must be closed before reopening in different mode.
COBOL
👁 0

Q: What is OPTIONAL file clause?

Answer:
OPTIONAL allows missing files: SELECT OPTIONAL input-file. OPEN succeeds even if file absent. READ immediately gets end-of-file. Useful for conditional processing. FILE STATUS 35 if accessed without OPTIONAL.
VSAM
👁 0

Q: How to delete records from KSDS?

Answer:
READ record with key. DELETE record-name. Status 00 if successful. In COBOL, DELETE uses primary key. Can delete current record after READ. Cannot delete from ESDS.
COBOL
👁 0

Q: What is APPLY WRITE-ONLY?

Answer:
APPLY WRITE-ONLY FOR file-name optimizes output buffer handling. System doesn't preserve record area after WRITE. Can't re-read just-written record. Improves I/O performance. Use when write-only access pattern is guaranteed.
VSAM
👁 0

Q: How to access AIX?

Answer:
Open PATH to AIX, not base cluster. READ via alternate key. Can browse by alternate key sequence. Updates depend on PATH UPDATE option. Non-unique AIX returns first, then READ NEXT for others.
VSAM
👁 0

Q: What is WRITECHECK?

Answer:
WRITECHECK verifies writes by reading back. Extra I/O for verification. Rarely needed with modern hardware. Can slow performance. Default off. Use only if data corruption suspected.
VSAM
👁 0

Q: How to handle concurrent access?

Answer:
Use appropriate SHAREOPTIONS. Multiple readers OK with SHAREOPTIONS(2). Writers need coordination. LSR (Local Shared Resources) for same address space. Consider file status checks.
VSAM
👁 0

Q: What is file status 47?

Answer:
Status 47 is READ attempted but file not open input. OPEN mode doesn't match operation. Must OPEN INPUT or I-O for READ. Check file OPEN statement and mode.
JCL
👁 0

Q: Explain DD DUMMY statement

Answer:
DD DUMMY discards output/provides EOF for input. No I/O actually performed. DUMMY, DSN=NULLFILE equivalent. Use to skip optional outputs or provide empty input. Program sees immediate EOF on read. Writes succeed but discarded.
VSAM
👁 0

Q: How to access VSAM via CICS?

Answer:
Define FILE in CICS FCT (File Control Table). Or RDO DEFINE FILE. EXEC CICS READ FILE. VSAM must be closed to batch when CICS owns. NSRV or LSR buffering. BROWSE for sequential.
VSAM
👁 0

Q: How to monitor VSAM performance?

Answer:
SMF records for I/O counts. LISTCAT for statistics (READS, WRITES, SPLITS). RMF reports. Third-party tools. Track CI/CA splits, EXCP counts, buffer hit ratios.
CICS
👁 0

Q: Explain REWRITE command

Answer:
REWRITE updates record. Must READ with UPDATE first. EXEC CICS REWRITE FILE(name) FROM(data) LENGTH(len). Changes record held from READ. Cannot change key. TOKEN matches UPDATE-READ.
CICS
👁 0

Q: What is DELETE command?

Answer:
DELETE removes record. EXEC CICS DELETE FILE(name) RIDFLD(key). Or after READ UPDATE: DELETE FILE(name). KEYLENGTH/GENERIC for range delete. NOTFND if key missing. NUMREC returns count deleted.
JCL
👁 0

Q: What is INTRDR?

Answer:
SYSOUT=(class,INTRDR) submits output as new job. Internal reader. Programs can submit jobs dynamically. Class often B. Output must be valid JCL. Used for job scheduling, dynamic workflows.
CICS
👁 0

Q: How to handle NOTFND condition?

Answer:
NOTFND means record not found. Check RESP: IF ws-resp = DFHRESP(NOTFND). Or HANDLE CONDITION NOTFND(para). Common for READ/DELETE. Handle gracefully - display message, take action.
CICS
👁 0

Q: Explain ASKTIME ABSTIME

Answer:
ABSTIME is packed decimal timestamp. Microseconds since 1/1/1900. ASKTIME returns current. FORMATTIME converts to readable. Use for calculations, comparisons. Full precision timing.
DB2
👁 0

Q: Explain DB2 isolation levels

Answer:
UR (Uncommitted Read) reads dirty data. CS (Cursor Stability) locks current row. RS (Read Stability) locks all accessed rows. RR (Repeatable Read) locks range, prevents phantom. Higher isolation = more consistency but more locking. CS most common.
CICS
👁 0

Q: Explain ITEMERR condition

Answer:
ITEMERR is item error in TS. Item number invalid. Out of range or doesn't exist. ITEM 1 is first. Check NUMITEMS. Common in READQ TS.
DB2
👁 0

Q: Explain DECLARE CURSOR syntax

Answer:
DECLARE cursor-name CURSOR FOR SELECT... WITH HOLD keeps open after COMMIT. WITH RETURN returns to caller. FOR UPDATE OF allows positioned update. FOR READ ONLY optimizes read. ORDER BY for sorting. Static or dynamic declaration.
CICS
👁 0

Q: Explain CICS web support

Answer:
CICS handles HTTP. EXEC CICS WEB READ/WRITE. URIMAP defines URLs. Programs handle requests. JSON/XML responses. Modern application interface.
VSAM
👁 0

Q: How to use BLDINDEX utility?

Answer:
BLDINDEX creates AIX entries from base. IDCAMS BLDINDEX INDATASET(base) OUTDATASET(aix). Reads base cluster, writes AIX. Required after AIX definition. EXTERNALSORT for large datasets.
CICS
👁 0

Q: What is EXEC CICS SPOOLOPEN?

Answer:
SPOOLOPEN accesses JES spool. SPOOLREAD/SPOOLWRITE for data. SPOOLCLOSE ends. Process job output. Modern batch integration. Requires authorization.
DB2
👁 0

Q: Explain NOFOR option in SELECT?

Answer:
NOFOR prevents FOR UPDATE locking. SELECT ... NOFOR. Read-only access without lock overhead. For display-only queries. Cannot UPDATE WHERE CURRENT OF cursor with NOFOR.