DB2 ⭐ Featured
👁 0

Q: How to handle SQLCODE -805?

Answer:
-805 is DBRM or package not found. Plan bound but package missing or invalidated. REBIND PACKAGE. Check collection, package name. Verify BIND completed successfully. May need BIND PLAN to add package.
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.
COBOL ⭐ Featured
👁 0

Q: How to handle variable length records?

Answer:
Use RECORD CONTAINS min TO max CHARACTERS clause in FD. Define RECORD-LENGTH field in the record. For VSAM, use RECORD VARYING IN SIZE. Access actual length via LENGTH OF or special register. Handle both fixed and variable portions appropriately.
DB2 ⭐ Featured
👁 0

Q: How to handle large objects (LOB)?

Answer:
BLOB/CLOB/DBCLOB for large data. Stored in auxiliary tablespace. Use LOB locators for efficiency. FETCH with INTO :lobvar. INSERT with CLOB(text). LOG NO for LOB tablespace optional.
DB2 ⭐ Featured
👁 0

Q: How to handle -551 SQLCODE?

Answer:
-551 is authorization failure. No privilege for operation. Check GRANT statements. May need SELECT, UPDATE, DELETE, INSERT authority. GRANT privilege ON object TO user/role. Check SYSIBM.SYSTABAUTH.
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: How to handle packed decimal data?

Answer:
Packed decimal (COMP-3) stores 2 digits per byte, sign in low nibble. PIC S9(5) COMP-3 uses 3 bytes. For I/O, often must convert to display. Use MOVE to display field or NUMVAL function. Handle sign separately if needed.
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.
DB2 ⭐ Featured
👁 0

Q: How to handle SQLCODE 100?

Answer:
SQLCODE 100 means not found or end of data. For SELECT INTO: no matching row. For FETCH: no more rows. For UPDATE/DELETE: no rows affected. Check context - may be normal condition, not error.
COBOL ⭐ Featured
👁 0

Q: How to handle EBCDIC/ASCII conversion?

Answer:
COBOL on mainframe uses EBCDIC natively. For ASCII conversion: use INSPECT CONVERTING, or file translation (JCL), or LE functions. NATIONAL-OF and DISPLAY-OF for Unicode. Different collating sequences affect SORT and comparisons.
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.
COBOL ⭐ Featured
👁 0

Q: How to handle OCCURS INDEXED tables?

Answer:
Indexed tables use INDEXED BY: 05 TBL OCCURS 10 INDEXED BY IDX. SET IDX TO 1 initializes. SET IDX UP BY 1 increments. SEARCH uses index implicitly. More efficient than subscript-index conversion.
VSAM ⭐ Featured
👁 0

Q: How to handle file status 22?

Answer:
Status 22 is duplicate key on WRITE or REWRITE attempt. KSDS primary key must be unique. Check program logic. May indicate data error. Use DUPLICATES option on AIX only if needed.
COBOL ⭐ Featured
👁 0

Q: How to handle binary data?

Answer:
COMP/BINARY stores binary. PIC S9(4) COMP is halfword (2 bytes). PIC S9(9) COMP is fullword (4 bytes). PIC S9(18) COMP is doubleword (8 bytes). SYNC aligns for performance. Value range limited by bytes, not picture.
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 handle VSAM in batch?

Answer:
Define cluster with IDCAMS. JCL DD statement references cluster. COBOL SELECT maps to DD. ACCESS MODE matches operations. Close properly. STATUS check after operations.
VSAM ⭐ Featured
👁 0

Q: How to handle status 44?

Answer:
Status 44 is boundary violation on sequential WRITE. Record too large for file definition. Check RECORDSIZE parameter. May need variable length definition. Truncation doesn't happen automatically.
CICS ⭐ Featured
👁 0

Q: How to handle CICS RESP codes?

Answer:
RESP and RESP2 capture command results. EXEC CICS command RESP(ws-resp) RESP2(ws-resp2). Check DFHRESP(NORMAL) for success. RESP contains condition. RESP2 has additional info. Always check after commands.
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.
CICS ⭐ Featured
👁 0

Q: What is ABEND command?

Answer:
ABEND deliberately terminates. EXEC CICS ABEND ABCODE('XXXX'). Causes transaction abend with code. NODUMP suppresses dump. CANCEL removes HANDLE ABEND first. Use for unrecoverable errors.
CICS ⭐ Featured
👁 0

Q: What is NOHANDLE option?

Answer:
NOHANDLE suppresses condition handling. EXEC CICS command NOHANDLE RESP(ws-resp). Program handles all conditions. No HANDLE CONDITION invoked. Cleaner error handling. Recommended approach.
CICS ⭐ Featured
👁 0

Q: How to handle DUPKEY?

Answer:
DUPKEY on WRITE means key exists. Check: IF ws-resp = DFHRESP(DUPKEY). Handle appropriately - maybe update instead. Or error to user. Common for insert logic.
JCL ⭐ Featured
👁 0

Q: What is FILEDATA parameter?

Answer:
FILEDATA specifies DCB for NFS/USS. FILEDATA=TEXT or BINARY. TEXT handles line endings. BINARY transfers unchanged. On PATH DD statements. Affects how data converted between systems.
JCL ⭐ Featured
👁 0

Q: What is SEGMENT parameter?

Answer:
SEGMENT limits output lines per dataset. On OUTPUT statement. SEGMENT=nnn pages per segment. JES creates multiple output datasets. Helps with huge print files. Easier to handle smaller pieces.
CICS ⭐ Featured
👁 0

Q: What is OVERFLOW condition?

Answer:
OVERFLOW when output exceeds page. During SEND with paging. Handle to manage paging. RESP check. Terminal specific limits. May need to restructure output.
JCL ⭐ Featured
👁 0

Q: Explain EROPT parameter?

Answer:
EROPT specifies error handling. DCB=(EROPT=ABE/ACC/SKP). ABE=abend on error, ACC=accept and continue, SKP=skip block. For tape I/O errors. Program may handle differently. Default is ABE.
DB2 ⭐ Featured
👁 0

Q: How to handle -904 SQLCODE?

Answer:
-904 is resource unavailable. Tablespace/index in restricted state, stopped, or unavailable. Check display status. May need START DATABASE command. Check for REORG, RECOVER, LOAD running. Wait and retry.
VSAM ⭐ Featured
👁 0

Q: How to handle RLS (Record Level Sharing)?

Answer:
RLS allows VSAM access without exclusive control. Define with SHAREOPTIONS and LOG. Enable RLS at VSAM level. CF lock structure coordinates. Better than old batch/CICS conflicts.
VSAM ⭐ Featured
👁 0

Q: How to handle SMS conversion?

Answer:
SMS manages storage automatically. Migrate VSAM to SMS: DATACLAS, STORCLAS, MGMTCLAS. ACS routines for assignment. Remove explicit VOL/UNIT. Benefits: automation, management.
DB2 ⭐ Featured
👁 0

Q: How to handle date arithmetic?

Answer:
DATE + n DAYS adds days. DATE - n MONTHS subtracts months. DAYS(date2) - DAYS(date1) gives day count. DATEDIFF function available. TIMESTAMPDIFF for time differences. DATE/TIME functions for extraction.
CICS ⭐ Featured
👁 0

Q: How to handle CICS timeout?

Answer:
Set RTIMOUT on transaction. EXEC CICS HANDLE CONDITION ERROR. DTIMOUT for deadlock. Program design for cleanup. TIMEOUT condition raised.
COBOL
👁 0

Q: Explain COMPUTE statement

Answer:
COMPUTE performs arithmetic with expression syntax. COMPUTE RESULT = (A + B) * C / D. Supports + - * / ** operators. ROUNDED option rounds result. ON SIZE ERROR handles overflow. Clearer than separate ADD/SUBTRACT/MULTIPLY/DIVIDE for complex formulas.
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: 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.
COBOL
👁 0

Q: What is ON SIZE ERROR?

Answer:
ON SIZE ERROR traps arithmetic overflow. COMPUTE X = A + B ON SIZE ERROR PERFORM error-handler END-COMPUTE. Also NOT ON SIZE ERROR for success. Must be enabled (TRUNC option). Prevents abends from overflow conditions.
COBOL
👁 0

Q: What is CURSOR IS clause?

Answer:
In Screen Section, CURSOR IS field-name positions cursor. ACCEPT screen-name WITH CURSOR. Runtime positions to specified field. Can set dynamically. Used in interactive COBOL (CICS typically handles cursor differently).
COBOL
👁 0

Q: How to handle negative numbers?

Answer:
Sign stored in PIC S9. SIGN IS LEADING/TRAILING SEPARATE CHARACTER for explicit sign byte. COMP-3 sign in low nibble. Display: S9(5)- shows trailing minus. +9(5) shows sign always. DB/CR for accounting format.
VSAM
👁 0

Q: How to handle multi-string access?

Answer:
STRNO parameter defines concurrent requests. More strings for high-activity files. Costs memory per string. JCL: AMP='STRNO=5'. Default usually 1. Batch usually needs 1-2.
VSAM
👁 0

Q: How to handle status 96?

Answer:
Status 96 is no DD statement for file. Check JCL has correct DD name. May be dynamic allocation failure. DD name must match SELECT ASSIGN. Case sensitive in some systems.
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.
CICS
👁 0

Q: How to handle MAPFAIL?

Answer:
MAPFAIL occurs when RECEIVE MAP finds no modified data. Handle: EXEC CICS RECEIVE MAP ... RESP(resp). IF resp = DFHRESP(MAPFAIL). User pressed Enter without typing. May need to redisplay or handle appropriately.
CICS
👁 0

Q: Explain HANDLE CONDITION

Answer:
HANDLE CONDITION sets error label. EXEC CICS HANDLE CONDITION NOTFND(para-notfnd). Jumps to label on condition. PUSH/POP HANDLE for nesting. Obsolete - prefer RESP option. Still seen in old code.
CICS
👁 0

Q: What is HANDLE ABEND?

Answer:
HANDLE ABEND traps abends. EXEC CICS HANDLE ABEND PROGRAM(abend-prog) or LABEL(abend-para). Allows cleanup before termination. CANCEL removes handler. Use for graceful error handling.
JCL
👁 0

Q: How to handle multivolume datasets?

Answer:
VOL=(,,,n) allows n volumes. SPACE with volume count. SMS handles multivolume automatically. DISP=MOD extends to new volume. DATACLAS can specify multivolume. Large datasets need multivolume planning.
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: What is MAPFAIL condition?

Answer:
MAPFAIL when RECEIVE MAP gets no data. Terminal timeout or clear. Handle: check RESP for DFHRESP(MAPFAIL). May need to resend map or handle timeout.
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.
CICS
👁 0

Q: How to handle ILLOGIC?

Answer:
ILLOGIC is VSAM logic error. Unusual error in file access. Check file status elsewhere. May indicate file corruption. Rare - investigate thoroughly.
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.
DB2
👁 0

Q: How to handle -803 SQLCODE?

Answer:
-803 is duplicate key violation. Primary key or unique index constraint. Check SQLERRD(3) for index ID. Solutions: check data, use IGNORE_DUPLICATE, handle in program logic. May indicate data quality issue.
CICS
👁 0

Q: How to handle CICS security?

Answer:
RACF/ACF2 integration. EXEC CICS QUERY SECURITY. SIGNON establishes identity. VERIFY checks resource access. XFCT/XPPT exits. Secure by default.
DB2
👁 0

Q: How to concatenate strings?

Answer:
Use CONCAT(str1, str2) or || operator. CONCAT('Hello', ' ', 'World'). || works same: col1 || col2. Handles VARCHAR properly. NULL concatenation yields NULL (use COALESCE). RTRIM to remove trailing spaces.
CICS
👁 0

Q: How to use PUSH/POP HANDLE?

Answer:
PUSH HANDLE saves current handlers. POP HANDLE restores. EXEC CICS PUSH HANDLE. Allows nested handler management. Clean up with POP. For modular code.