👁 0
Q: What is ROW_NUMBER()?
Answer:
ROW_NUMBER() assigns sequential numbers. ROW_NUMBER() OVER (ORDER BY col). Numbers restart per PARTITION BY group. Use for paging, deduplication (keep first), ranking. Result is numeric.
👁 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 identity column?
Answer:
Identity column auto-generates values. col INTEGER GENERATED ALWAYS AS IDENTITY. Or GENERATED BY DEFAULT (allows override). Start, increment configurable. Alternative to sequence for single-table keys.
👁 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.
👁 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.
👁 0
Q: Explain WRITE BEFORE/AFTER ADVANCING
Answer:
ADVANCING controls line spacing for print files. WRITE rec AFTER ADVANCING 2 LINES skips 2 lines first. WRITE rec BEFORE ADVANCING PAGE starts new page after. WRITE rec AFTER PAGE goes to new page first. Controls report formatting.
👁 0
Q: What is RBA?
Answer:
RBA (Relative Byte Address) is byte offset from dataset start. ESDS uses RBA for access. KSDS index points to RBA. Changed by REORG. Use key for KSDS, RBA only when necessary.
👁 0
Q: What is symbolic parameter?
Answer:
Symbols are variables: SET symbol=value or &symbol on JOB/PROC. Reference: DSN=&HLQ..DATA. Resolved at job entry. EXEC proc,symbol=value overrides. SET statement defines. Symbols start with & and up to 8 characters.
👁 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.
👁 0
Q: What is pseudo-conversational programming?
Answer:
Pseudo-conversational ends task after sending screen, restarts on input. EXEC CICS RETURN TRANSID(trans) COMMAREA(data). Saves resources - no task waiting for user. Must restore state from COMMAREA. Standard CICS approach.
👁 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: How to do interval control?
Answer:
START with INTERVAL/AFTER for delayed execution. EXEC CICS START TRANSID(xx) INTERVAL(001000). Or AFTER HOURS(1) MINUTES(30). For scheduled background work. Data via FROM or CHANNEL.
👁 0
Q: What is IMMEDIATE option?
Answer:
IMMEDIATE on RETURN returns without COMMAREA. EXEC CICS RETURN IMMEDIATE. Next input starts fresh - no continuation. Use when pseudo-conv not needed.
👁 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.
👁 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.
👁 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.
👁 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.
👁 0
Q: How to write recursive CTE?
Answer:
WITH RECURSIVE cte AS (base-case UNION ALL recursive-case referencing cte) SELECT * FROM cte. For hierarchies: start with root, join to find children. DEPTH limit prevents infinite recursion.
👁 0
Q: Explain sequence objects
Answer:
SEQUENCE generates unique numbers. CREATE SEQUENCE name START WITH 1 INCREMENT BY 1. NEXT VALUE FOR sequence-name gets next. Used for keys. Cached for performance. No gaps guaranteed.
👁 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.
👁 0
Q: What is zparm?
Answer:
ZPARM (DSNZPARMs) are DB2 installation parameters. Control system behavior, limits, defaults. DSNZPARM module loaded at startup. Changes need restart usually. Critical for performance and security tuning.
👁 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.
👁 0
Q: Explain SPEED vs RECOVERY
Answer:
SPEED skips CI/CA recovery info during load. Faster but risky. RECOVERY (default) writes recovery info. If job abends, RECOVERY allows restart. SPEED needs complete reload if problem.
👁 0
Q: What is TITLE statement?
Answer:
TITLE 'Page Header' sets listing page headers. Appears on each page of compilation listing. Useful for documentation. Multiple TITLES change as encountered. After IDENTIFICATION DIVISION start. Compiler directive, not executable.
👁 0
Q: How to switch file for restart?
Answer:
IDCAMS DELETE/DEFINE or REUSE attribute. REUSE allows OPEN OUTPUT reset. Alternative: JCL with DISP=(NEW,CATLG,DELETE) pattern. Checkpoints may need restart considerations.
👁 0
Q: Explain RESTART parameter
Answer:
RESTART=stepname restarts job at specified step. RESTART=(stepname,checkid) for checkpointed restart. Use after abend to continue from failure point. Prior steps skipped. Data must be recoverable or recreatable.
👁 0
Q: What is CLASS parameter?
Answer:
CLASS assigns job to execution class. CLASS=A on JOB card. Initiators start jobs by class. Determines execution priority, resources. Installations define class characteristics. Multiple classes: CLASS=AB (not common). JES2/JES3 interpret differently.
👁 0
Q: Explain JES2 control cards
Answer:
JES2 cards start with /*. /*JOBPARM limits resources. /*ROUTE sends output. /*OUTPUT JESDS specifies JES output. /*PRIORITY sets priority. Process by JES2, not passed to job. Position after JOB card before first EXEC.
👁 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: What is CEDF?
Answer:
CEDF is execution diagnostic facility. Debug tool. CEDF ON intercepts EXEC CICS. Step through commands. Display/modify data. Powerful debugging. CEDF transaction-id starts debug.
👁 0
Q: What is CICS asynchronous processing?
Answer:
RUN TRANSID for async execution. EXEC CICS RUN TRANSID(xx) CHILD. FETCH CHILD waits for completion. Modern async pattern. Alternative to START.
👁 0
Q: How to do paging with DB2?
Answer:
Use FETCH FIRST n ROWS ONLY with OFFSET or ROW_NUMBER(). Modern: SELECT * FROM (SELECT ROW_NUMBER() OVER(ORDER BY col) AS rn, t.* FROM table t) WHERE rn BETWEEN start AND end. Or cursor with FETCH FIRST.
👁 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.