👁 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: What is SQLCODE and what are common values?
Answer:
SQLCODE is a return code in SQLCA indicating the result of SQL execution.
Common SQLCODE values:
| 0 | Successful execution |
| 100 | No data found / End of cursor |
| -803 | Duplicate key on insert |
| -811 | Multiple rows returned for singleton SELECT |
| -904 | Unavailable resource |
| -911 | Deadlock/timeout |
| -922 | Authorization failure |
| -927 | DB2 not available |
Negative = Error, 0 = Success, 100 = No data
👁 0
Q: What is temporal table?
Answer:
Temporal tables track historical data. SYSTEM_TIME versioning automatic. APPLICATION_TIME for business time. Query AS OF for point-in-time. History table stores old versions. Built-in time travel.
👁 0
Q: What is dynamic SQL?
Answer:
Dynamic SQL constructed at runtime. PREPARE creates executable. EXECUTE runs it. EXECUTE IMMEDIATE for one-time. DECLARE CURSOR for queries. More flexible but less efficient than static. Security concerns (injection).
👁 0
Q: What is USE BEFORE REPORTING?
Answer:
In Report Writer, USE BEFORE REPORTING procedure runs before printing. USE BEFORE REPORTING report-group-name. Allows dynamic modification of report data. Can suppress or modify lines based on runtime conditions.
👁 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: What is ERASE on DELETE?
Answer:
ERASE overwrites data with binary zeros. Physical erase before space release. Security requirement for sensitive data. Takes time. Without ERASE, data remains until overwritten.
👁 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.
👁 0
Q: How to use SET statement?
Answer:
SET symbol=value assigns value. SET DATE=&LYYMMDD (system symbol). Multiple: SET A=1,B=2. Scope: job/proc. Override on EXEC. SET can reference other symbols. Evaluated at conversion time. Enables parameter files.
👁 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 WAIT EVENT?
Answer:
WAIT suspends until event. EXEC CICS WAIT EVENT ECBLIST(ecb-list). Multiple ECBs. Returns when any posted. Used for synchronization. Timer events, external events.
👁 0
Q: What is CICS monitoring?
Answer:
CICS monitoring facilities. SMF 110 records. CICS statistics. Transaction analysis. Performance data. OMEGAMON for real-time. Capacity planning.
👁 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.
👁 0
Q: What is DISTINCT keyword?
Answer:
DISTINCT eliminates duplicate rows. SELECT DISTINCT col FROM table. Applies to entire row, not single column. Causes sort for duplicate elimination. Performance impact. Avoid if possible. Sometimes indicates bad design.
👁 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 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.
👁 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.
👁 0
Q: What is BETWEEN operator?
Answer:
BETWEEN tests range inclusively. WHERE col BETWEEN 1 AND 100. Equivalent to col >= 1 AND col <= 100. Works with dates, times. Can use NOT BETWEEN for exclusion. Index can be used for BETWEEN.
👁 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.
👁 0
Q: Explain partitioning strategies
Answer:
Range partitioning by value ranges (date, key ranges). Hash partitioning distributes evenly. Partition independence allows parallel operations. Partition pruning improves queries. Rotate partitions for time-series.
👁 0
Q: How to monitor DB2 performance?
Answer:
Use OMEGAMON, DB2PM, or built-in monitor. Check: buffer pool hit ratios, lock waits, CPU time, elapsed time. DISPLAY commands show real-time. Statistics trace for analysis. EXPLAIN for query level.
👁 0
Q: What is LINKAGE SECTION?
Answer:
LINKAGE SECTION defines parameters received from calling program. Items here have no memory until CALL provides addresses via USING clause. Address established at runtime. Used for both passed parameters and dynamically addressed data.
👁 0
Q: Explain UPGRADE attribute
Answer:
UPGRADE keeps AIX synchronized with base cluster. Changes to base automatically update upgraded AIX. Adds overhead to writes. Non-upgrade AIX needs manual BLDINDEX. Use UPGRADE for real-time currency.
👁 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).
👁 0
Q: What causes S322 abend?
Answer:
S322 is job/step time exceeded. Check TIME parameter on JOB/EXEC. Causes: infinite loop, too much data, insufficient time allocated. Fix: increase TIME, optimize program, check data volumes. TIME=1440 is no limit (24 hours).
👁 0
Q: How to use INCLUDE statement?
Answer:
INCLUDE MEMBER=name inserts JCL from JCLLIB member. Processed at conversion time. Can contain any JCL statements. Modular JCL design. INCLUDE can contain INCLUDE. SET statements affect included members.
👁 0
Q: What is ASSIGN command?
Answer:
ASSIGN retrieves system values. EXEC CICS ASSIGN USERID(ws-user) FACILITY(ws-term). Other options: SYSID, ABCODE, PROGRAM. Gets runtime environment info. Useful for audit, conditional processing.
👁 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.
👁 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: 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.
👁 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: What causes -911 SQLCODE?
Answer:
-911 is deadlock or timeout. Two processes waiting for each other's resources. Solutions: consistent lock order, shorter transactions, COMMIT frequently, appropriate isolation level. -913 is similar (deadlock victim). Retry transaction.
👁 0
Q: How to use DOCTEMPLATE?
Answer:
DOCTEMPLATE defines dynamic content. Create template with symbols. Insert data at runtime. EXEC CICS DOCUMENT SET/INSERT. For generating responses.