Here are examples to use RIDFLD in CICS for Reading, writing the VSAM files

RIDFLD During RERD With UPDATE

First step is you need to read a record from file with UPDATE option. Else, CICS treats it as READ only.

Example Code:

EXEC CICS
READ FILE(FILEA) INTO(Record1) 
RIDFLD(Key1)
UPDATE
END-EXEC

RIDFLD During REWRITE

You need to use REWRITE options to UPDATE VSAM files.

Example Code:

EXEC CICS
REWRITE FILE(FILEA) FROM(Record1) 
RIDFLD(Key1)
END-EXEC

Purpose of RIDFLD in CICS

  1. RIDFLD should be given while reading a VSAM record for update
  2. RIDFLD may be a Key or RBN or RRN
  3. For RBN, the RIDFLD should be greater than or equal to zero
  4. For RRN, the RIDFLD should be greater than or equal to 1
  5. For RBN, the RIDFLD should be fullword bynary

Keep Reading