CICS ⭐ Featured
👁 0

Q: What is pseudo-conversational programming in CICS?

Answer:

Pseudo-conversational programming is a technique where the program ends between user interactions, freeing system resources.

How it works:

  1. Program sends screen to user and ends (RETURN TRANSID)
  2. User enters data and presses Enter
  3. CICS starts a new task with same program
  4. Program retrieves saved data from COMMAREA
  5. Process continues

Benefits:

  • Efficient resource usage
  • Better response times
  • More concurrent users

Implementation:

* End task, wait for user
EXEC CICS RETURN
    TRANSID('MENU')
    COMMAREA(WS-COMM)
    LENGTH(100)
END-EXEC.

* On return, check EIBCALEN
IF EIBCALEN = 0
    PERFORM FIRST-TIME
ELSE
    MOVE DFHCOMMAREA TO WS-COMM
    PERFORM PROCESS-INPUT
END-IF.
COBOL ⭐ Featured
👁 0

Q: Explain REDEFINES clause with an example.

Answer:

REDEFINES allows the same storage area to be referenced by different data names with different definitions.

Rules:

  • Must be at same level as item being redefined
  • Cannot redefine item with OCCURS
  • Redefined item must appear first
  • Lengths should match or redefining should be shorter
01 WS-DATE.
   05 WS-DATE-NUM    PIC 9(8).
01 WS-DATE-X REDEFINES WS-DATE.
   05 WS-YEAR        PIC 9(4).
   05 WS-MONTH       PIC 9(2).
   05 WS-DAY         PIC 9(2).

Same 8 bytes can be accessed as single number or individual components.

CICS ⭐ Featured
👁 0

Q: What is the purpose of COMMAREA in CICS?

Answer:

COMMAREA (Communication Area) is used to pass data between programs or between transactions in pseudo-conversational programming.

Uses:

  • Pass data between LINK/XCTL programs
  • Save data between pseudo-conversational transactions
  • Maximum size: 32KB

How it works:

  1. Calling program: COMMAREA option on LINK/XCTL/RETURN
  2. Called program: DFHCOMMAREA in LINKAGE SECTION
  3. Check EIBCALEN for length (0 = no COMMAREA)
* Calling program
EXEC CICS LINK
    PROGRAM('SUBPROG')
    COMMAREA(WS-DATA)
    LENGTH(100)
END-EXEC.

* Called program
LINKAGE SECTION.
01 DFHCOMMAREA PIC X(100).

IF EIBCALEN > 0
    MOVE DFHCOMMAREA TO WS-DATA
END-IF.
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.
COBOL ⭐ Featured
👁 0

Q: What is RECORDING MODE for files?

Answer:
RECORDING MODE specifies record format: F=fixed, V=variable, U=undefined, S=spanned. RECORDING MODE IS V for variable records. Affects how records are blocked and how length is tracked. Must match JCL DCB specifications.
VSAM ⭐ Featured
👁 0

Q: What is RRDS in VSAM?

Answer:
RRDS (Relative Record Dataset) accesses by relative record number (slot). Fixed length slots numbered 1, 2, 3... Can be empty slots. Good for direct access by position. Less common than KSDS/ESDS.
VSAM ⭐ Featured
👁 0

Q: What is KSDS key format?

Answer:
Keys defined by KEYS(length offset). Offset is 0-based. Key extracted from record at offset for length bytes. Alphanumeric comparison. Numeric keys need proper format. Key must be contiguous.
VSAM ⭐ Featured
👁 0

Q: Explain RECORDSIZE parameter

Answer:
RECORDSIZE(average maximum). For variable length records. Average used for space calculation. Maximum is hard limit. Fixed length: same average and max. Space formula uses average.
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.
COBOL ⭐ Featured
👁 0

Q: What is XML GENERATE?

Answer:
XML GENERATE creates XML from data. XML GENERATE output FROM data-item. Optional: COUNT IN length, WITH ENCODING, WITH XML-DECLARATION. Generates element for each field. Names from data names. COBOL 5+ feature.
JCL ⭐ Featured
👁 0

Q: Explain DCB parameter

Answer:
DCB defines Data Control Block: RECFM (F/FB/V/VB/U), LRECL (record length), BLKSIZE (block size). DCB=(RECFM=FB,LRECL=80,BLKSIZE=27920). Can inherit from existing dataset. LRECL required for new datasets. BLKSIZE=0 lets system optimize.
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: What is COMMAREA and how to use it?

Answer:
COMMAREA (Communication Area) passes data between programs and transactions. EXEC CICS LINK/XCTL COMMAREA(data) LENGTH(len). Receiving program has DFHCOMMAREA in LINKAGE. Max 32KB. Preserved across pseudo-conversational iterations.
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.
JCL ⭐ Featured
👁 0

Q: Explain PARM parameter

Answer:
PARM passes data to program. EXEC PGM=PROG,PARM='value'. Max 100 characters. Program receives length prefix. PARM='abc,xyz' passes as one string. Program parses. Special chars need quotes. Alternative: SYSIN for larger data.
CICS ⭐ Featured
👁 0

Q: What is EIB?

Answer:
EIB (Execute Interface Block) contains execution info. EIBCALEN=COMMAREA length. EIBTRNID=transaction. EIBAID=attention key. EIBDATE/EIBTIME=date/time. EIBRESP/EIBRESP2=response codes. Automatically available in COBOL.
CICS ⭐ Featured
👁 0

Q: What is WRITE command?

Answer:
WRITE adds new record. EXEC CICS WRITE FILE(name) FROM(data) RIDFLD(key) LENGTH(len). DUPREC condition if key exists. KEYLENGTH for generic. MASSINSERT optimizes bulk loads.
CICS ⭐ Featured
👁 0

Q: How to use ENQ/DEQ?

Answer:
ENQ serializes resources. EXEC CICS ENQ RESOURCE(name) LENGTH(len). DEQ releases. Prevents concurrent access. NOSUSPEND returns immediately if busy. Use for data integrity.
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.
CICS ⭐ Featured
👁 0

Q: How to use RETRIEVE command?

Answer:
RETRIEVE gets data passed via START. EXEC CICS RETRIEVE INTO(area) LENGTH(len). Data from START FROM parameter. Or RETRIEVE CHANNEL for containers. One retrieve per start.
JCL ⭐ Featured
👁 0

Q: What causes INVALID DATA SET NAME?

Answer:
Dataset name violates rules: 44 char max, qualifier 8 max, start with letter/national, periods separate qualifiers, no double periods, no special characters. Check spelling, length, valid characters.
JCL ⭐ Featured
👁 0

Q: What is LRECL=X?

Answer:
LRECL=X means system-determined length. Usually for RECFM=U or special files. System calculates based on BLKSIZE or file characteristics. Not common for normal datasets. Used with certain utilities.
CICS ⭐ Featured
👁 0

Q: How to use CURSOR option?

Answer:
CURSOR positions cursor on SEND MAP. EXEC CICS SEND MAP CURSOR(pos). Position number from 0. Or CURSOR option in symbolic map (-1 in length field). Controls data entry flow.
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.
VSAM ⭐ Featured
👁 0

Q: What is maximum VSAM key length?

Answer:
Maximum key length is 255 bytes. KEYS(255 offset). Practical limits lower for performance. Index size grows with key. Keep keys reasonably sized.
COBOL
👁 0

Q: How to use OCCURS DEPENDING ON?

Answer:
OCCURS DEPENDING ON creates variable-length tables. 01 WS-TABLE. 05 WS-COUNT PIC 99. 05 WS-ITEM OCCURS 1 TO 100 DEPENDING ON WS-COUNT. Only variable entries allocated based on counter. Used with variable length records.
COBOL
👁 0

Q: What is reference modification?

Answer:
Reference modification extracts substring: WS-FIELD(start:length). WS-NAME(1:3) gets first 3 characters. Can use in MOVE, IF, DISPLAY. Start position is 1-based. Length optional (to end). More flexible than REDEFINES for variable positions.
COBOL
👁 0

Q: How to use intrinsic functions?

Answer:
COBOL-85 intrinsic functions: FUNCTION LENGTH(field), FUNCTION CURRENT-DATE, FUNCTION UPPER-CASE(field), FUNCTION NUMVAL(field), FUNCTION MOD(a,b), FUNCTION INTEGER-OF-DATE(date). Use in expressions or with COMPUTE. Return values only, no side effects.
COBOL
👁 0

Q: Explain FUNCTION LENGTH

Answer:
FUNCTION LENGTH returns byte count. FUNCTION LENGTH(field-name). For group items, includes all subordinates. For variable OCCURS, actual current length. Use in COMPUTE, MOVE, comparisons. Often used with STRING pointer initialization.
COBOL
👁 0

Q: Explain JSON GENERATE

Answer:
JSON GENERATE creates JSON from data. JSON GENERATE output FROM data-item. NAME clause for custom keys. SUPPRESS clause omits fields. COUNT IN length. COBOL V6+ feature. Generates name-value pairs from structure.
CICS
👁 0

Q: Explain START command

Answer:
START schedules transaction for later. EXEC CICS START TRANSID(trans) AFTER HOURS(1) FROM(data). INTERVAL or TIME for specific time. Data passed in channel/container or FROM/LENGTH. Background processing.
CICS
👁 0

Q: What is GETMAIN?

Answer:
GETMAIN allocates temporary storage. EXEC CICS GETMAIN SET(pointer) LENGTH(size) INITIMG(X'00'). Returns pointer. Use for dynamic memory. FREEMAIN releases. SHARED for multi-task access. Automatic cleanup on task end.
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 KEYLEN parameter?

Answer:
KEYLEN specifies key length for new dataset. DCB parameter for VSAM-like. Or VSAM DEFINE CLUSTER KEYS(length offset). Length 1-255. Required for indexed organization. Offset from 0 or 1 depending on context.
CICS
👁 0

Q: What is BIF DEEDIT?

Answer:
BIF DEEDIT removes edit characters. EXEC CICS BIF DEEDIT FIELD(data) LENGTH(len). Converts edited numeric to raw. Removes $, commas, etc. Useful for BMS numeric input.
CICS
👁 0

Q: Explain CICS RECEIVE without MAP

Answer:
RECEIVE INTO without MAP gets raw terminal data. EXEC CICS RECEIVE INTO(area) LENGTH(len). For non-BMS screens. AID in EIBAID. Raw data stream. Lower level than BMS.
CICS
👁 0

Q: What is LENGERR?

Answer:
LENGERR is length error. Data too large for area, or length specification wrong. Check LENGTH values. Common on RECEIVE. Ensure adequate receiving field.
DB2
👁 0

Q: What is SUBSTR function?

Answer:
SUBSTR extracts substring. SUBSTR(string, start, length). SUBSTR(name, 1, 3) gets first 3 chars. Position starts at 1. Length optional (to end). Can use in WHERE for pattern matching.