View previous topic :: View next topic
|
Author |
Message |
picus_mf Warnings : 1 New User
Joined: 09 Jun 2006 Posts: 52
|
|
|
|
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).
Code: |
77 WS-IP-RBIV-LENGTH PIC S9(9) COMP VALUE 31660.
77 WS-MMWCRBIV-KEY-LEN PIC S9(4) COMP VALUE +22.
EXEC CICS STARTBR
DATASET ('MMWCRVIV')
RIDFLD (MM-WCIV-KEY) -> key length is 22
KEYLENGTH (WS-MMWCRBIV-KEY-LEN)
GTEQ
END-EXEC.
SKIP1
EXEC CICS READNEXT
DATASET ('MMWCRVIV')
RIDFLD (MM-WCIV-KEY)
LENGTH (WS-IP-RBIV-LENGTH) - length is 31660
INTO (WS-MMWCRBIV-RECORD)
END-EXEC.
|
Not sure what is the actual wrong I have done. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 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. |
|
Back to top |
|
|
picus_mf Warnings : 1 New User
Joined: 09 Jun 2006 Posts: 52
|
|
|
|
Yes. Issue is resolved. Thanks a lot. |
|
Back to top |
|
|
|