👁 0
Q: What is the difference between PARM and SYSIN for passing parameters?
Answer:
PARM (EXEC statement):
- Limited to 100 characters
- Passed in memory to program
- Accessed via LINKAGE SECTION
- Good for small, simple parameters
SYSIN (DD statement):
- No practical size limit
- Read as a file by program
- Can contain multiple records
- Good for control cards, complex input
// PARM example //STEP1 EXEC PGM=MYPROG,PARM='PARAM1,PARAM2' // SYSIN example //SYSIN DD * CONTROL OPTION1 DATE=20231215 LIMIT=1000 /*
👁 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:
- Calling program: COMMAREA option on LINK/XCTL/RETURN
- Called program: DFHCOMMAREA in LINKAGE SECTION
- 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.
👁 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.
👁 0
Q: Explain REDEFINES clause usage
Answer:
REDEFINES allows multiple data descriptions for same memory. 01 WS-DATE PIC 9(8). 01 WS-DATE-R REDEFINES WS-DATE. 05 WS-YEAR PIC 9(4). 05 WS-MONTH PIC 99. 05 WS-DAY PIC 99. Cannot redefine with larger size. Useful for different views of data.
👁 0
Q: What is USAGE clause?
Answer:
USAGE specifies internal data representation. DISPLAY (default)=character, COMP/BINARY=binary, COMP-3/PACKED-DECIMAL=packed, COMP-1=single float, COMP-2=double float. Affects storage size and arithmetic performance.
👁 0
Q: How to define KSDS cluster?
Answer:
IDCAMS DEFINE CLUSTER(NAME(ds.name) INDEXED KEYS(len offset) RECORDSIZE(avg max) SHAREOPTIONS(2 3)) DATA(NAME(ds.data) CYLINDERS(5 1)) INDEX(NAME(ds.index) CYLINDERS(1 1)). Keys required for INDEXED.
👁 0
Q: What is CI and CA in VSAM?
Answer:
CI (Control Interval) is I/O unit, like block. Contains records, free space, control info. CA (Control Area) is group of CIs. CISIZE affects performance. CI split when full. CA split more expensive.
👁 0
Q: What is SPANNED record?
Answer:
Spanned records exceed CI size, span multiple CIs. DEFINE CLUSTER ... RECORDSIZE(avg max) SPANNED. CI too small for max record. Performance impact. Use appropriately sized CI when possible.
👁 0
Q: How to use STRING with POINTER?
Answer:
STRING uses POINTER to track position: STRING field-1 DELIMITED SIZE INTO output WITH POINTER pos-var. Pointer shows next available position. Initialize before first STRING. Check for overflow. Continue STRING in multiple statements.
👁 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.
👁 0
Q: What is OBJECT-COMPUTER paragraph?
Answer:
OBJECT-COMPUTER describes execution machine. OBJECT-COMPUTER. IBM-3090. MEMORY SIZE clause deprecated. PROGRAM COLLATING SEQUENCE for sort order. SEGMENT-LIMIT for overlay. Mostly documentation now; compiler usually ignores.
👁 0
Q: How to access RRDS?
Answer:
ACCESS MODE IS RANDOM. Use RELATIVE KEY for slot number. READ/WRITE by slot. STATUS 23 if slot empty. Can have empty slots. Record size fixed for RRDS.
👁 0
Q: What is CISIZE calculation?
Answer:
CISIZE must hold at least one record plus overhead. Formula complex. Let system default usually best. Common sizes: 4096, 8192, 16384. Larger CI can improve sequential, hurt random.
👁 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.
👁 0
Q: How to improve KSDS performance?
Answer:
Appropriate CISIZE, FREESPACE. Adequate buffers (BUFND/BUFNI). Index in cache if possible. IMBED obsolete. Keep file organized (REORG). Monitor CA/CI splits. Sequential access for bulk.
👁 0
Q: Explain SPACE parameter options
Answer:
SPACE=(unit,(primary,secondary,directory)). Unit: TRK/CYL/block-size. Primary allocated first, secondary in 15 increments. Directory only for PDS. RLSE releases unused. CONTIG requires contiguous. Example: SPACE=(CYL,(10,5,20),RLSE)
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 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.
👁 0
Q: How to use SUBTRACT CORRESPONDING?
Answer:
SUBTRACT CORRESPONDING subtracts matching fields. SUBTRACT CORR group-1 FROM group-2. Each matching numeric field in group-2 decreased by corresponding group-1 value. Use ROUNDED and SIZE ERROR options. Limited to numeric fields.
👁 0
Q: What causes file status 34?
Answer:
Status 34 is boundary violation or record too large. Record exceeds defined maximum. Check RECORDSIZE definition. May have wrong record format. Truncation not automatic.
👁 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: What is CONTROLINTERVALSIZE?
Answer:
CONTROLINTERVALSIZE sets CI size explicitly. CONTROLINTERVALSIZE(4096). Powers of 2, max 32768. Let system default usually. Larger CI better sequential, worse random. Match to workload.
👁 0
Q: How to resize VSAM?
Answer:
Cannot resize directly. REPRO out, DELETE, DEFINE larger, REPRO back. Or ALTER to add secondary space/volumes. Planning important - define adequate size initially.
👁 0
Q: How to define ESDS?
Answer:
DEFINE CLUSTER(NAME(ds.name) NONINDEXED RECORDSIZE(avg max)) DATA(NAME(ds.data) CYLINDERS(10 2)). NONINDEXED means ESDS. No KEYS or INDEX components. Access by RBA only.
👁 0
Q: Explain DEFINE CLUSTER syntax
Answer:
DEFINE CLUSTER(NAME(ds) ...) DATA(NAME(ds.data) ...) INDEX(NAME(ds.index) ...). CLUSTER level: type, SHAREOPTIONS. DATA level: space, RECORDSIZE. INDEX level: space for KSDS index.
👁 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.
👁 0
Q: What is DB2 buffer pool?
Answer:
Buffer pool caches data/index pages in memory. BP0, BP1, etc. Hit ratio critical for performance. GETPAGE vs SYNCIO shows effectiveness. Size appropriately. Virtual buffer pool for each pool. Monitor with statistics.