I am trying to read a KSDS VSAM file which is of Fixed length with 31660 length. My goal is to read this VSAM file sequentially and process the records present in it. So doing a START BROWSE with low-values in the key and then doing READNEXT.
The start browse is working fine with RESP code 0 but the READNEXT is failing with EIBRESP 22 and EIBRESP2 13 (length error).
77 WS-IP-RBIV-LENGTH PIC S9(9) COMP VALUE 31660.
77 WS-MMWCRBIV-KEY-LEN PIC S9(4) COMP VALUE +22.
Joined: 14 Jan 2008 Posts: 2502 Location: Atlanta, Georgia, USA
Field "WS-IP-RBIV-LENGTH" needs to be defined as PIC S9(4) COMP VALUE 31660.
Because you're assigning a VALUE clause to this field (and the VALUE exceeds the Picture Clause size), you can either specify the TRUNC(BIN) compiler option (to avoid high-order truncation) or define this field as COMP-5 (Native Binary), providing your compiler supports this.
The TRUNC option has no effect on COMP-5.
Most lengths (but not all) in CICS API's are halfword-binary, as illustrated.