👁 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:
- Program sends screen to user and ends (RETURN TRANSID)
- User enters data and presses Enter
- CICS starts a new task with same program
- Program retrieves saved data from COMMAREA
- 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.
👁 0
Q: How does SEARCH ALL differ from SEARCH?
Answer:
SEARCH performs a sequential/linear search from the current index position. SEARCH ALL performs a binary search requiring the table to be sorted (ASCENDING/DESCENDING KEY clause) and indexed. SEARCH ALL is faster for large tables but requires sorted data.
👁 0
Q: How to use EXIT PERFORM?
Answer:
EXIT PERFORM immediately exits current PERFORM loop. EXIT PERFORM CYCLE skips to next iteration. COBOL 2002+ feature. Previously used GO TO with OUT-OF-PARAGRAPH technique. Makes loop control cleaner without extra flags.
👁 0
Q: How to use FUNCTION CURRENT-DATE?
Answer:
FUNCTION CURRENT-DATE returns 21-char timestamp. Format: YYYYMMDDHHMMSSDHHMM (D=hundredths, HH=GMT offset). MOVE FUNCTION CURRENT-DATE TO WS-TIMESTAMP. Parse components with reference modification or REDEFINES.
👁 0
Q: How to define GDG in JCL?
Answer:
Create GDG base with IDCAMS DEFINE GDG. Reference generations: DSN=MY.GDG(+1) for new, DSN=MY.GDG(0) for current, DSN=MY.GDG(-1) for previous. DISP=(NEW,CATLG) for +1. Model DSCB needed for SMS-managed datasets.
👁 0
Q: Explain UPGRADE path AIX?
Answer:
UPGRADE AIX maintained automatically on base cluster changes. PATH allows access but not update. PATH with UPDATE allows updates via alternate key. UPGRADE adds overhead but keeps AIX current.
👁 0
Q: Explain CICS task and transaction
Answer:
Transaction is unit of work started by TRANSID. Task is CICS execution instance. One transaction may create multiple tasks. Task has TCA (Task Control Area). EIBTRNID has transaction ID. Concurrent tasks share resources.
👁 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.
👁 0
Q: Explain generation data groups
Answer:
GDG maintains versions. Base defined with IDCAMS: DEFINE GDG NAME(base) LIMIT(10) SCRATCH. Reference: base(+1) new, base(0) current, base(-1) previous. LIMIT controls kept generations. NOEMPTY/EMPTY for empty condition.
👁 0
Q: How to use INQUIRE command?
Answer:
INQUIRE retrieves resource status. EXEC CICS INQUIRE FILE(name) OPENSTATUS(ws-status). INQUIRE TRANSACTION, PROGRAM, etc. Returns current state. Use for dynamic decisions.
👁 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.
👁 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.
👁 0
Q: What is FREE parameter?
Answer:
FREE specifies when to release allocation. FREE=END (default) at step end. FREE=CLOSE when file closed. FREE=CLOSE allows reuse within step. Reduces concurrent allocations. Helps resource-constrained systems.
👁 0
Q: What is CURRENT DATE function?
Answer:
CURRENT DATE returns today's date. CURRENT TIME for time. CURRENT TIMESTAMP for both. No parentheses needed. Used in SELECT, WHERE, INSERT. Can compare: WHERE hire_date > CURRENT DATE - 30 DAYS.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 0
Q: What is FETCH SENSITIVE cursor?
Answer:
SENSITIVE cursor reflects concurrent changes by other processes. EXEC SQL DECLARE cursor SENSITIVE STATIC/DYNAMIC SCROLL CURSOR. INSENSITIVE does not see changes. Affects isolation behavior. Consider performance impact.
👁 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.