IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

E1BRESP 22 while doing readnext


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Tue Sep 01, 2020 1:17 am
Reply with quote

Hello,

I am trying to read a VSAM KSDS file sequentially and getting EIBRESP 22 .

length of key is 28 and I am moving first 20 to do a partial read.

EXEC CICS STARTBR

DATASET ('AMTFILE')
RIDFLD(WS-AMT-KEY)
GTEQ
RESP(RESP-CODE)

END-EXEC


MOVE LENGTH OF WS-AMT-REC TO WS-AMT-REC-LEN

EXEC CICS READNEXT

DATASET ('AMTFILE')
INTO(WS-AMT-REC)
RIDFLD(WS-AMT-KEY)
LENGTH(WS-AMT-REC-LEN)
RESP(RESP-CODE)

END-EXEC


WS-AMT-REC-LEN is declared with COMP-5 PIC 9(4).
WS-AMT-KEY has a length of 80.


I added the MOVE statement above after looking at solution for a similar error here.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8569
Location: Dubuque, Iowa, USA

PostPosted: Tue Sep 01, 2020 2:32 am
Reply with quote

From the manual on the READNEXT EIBRESP codes:
Quote:
22 LENGERR
RESP2 values:
10 Neither the LENGTH nor the SET option is specified for a file with variable-length records or a BDAM file with undefined-format records.
11 The length of the record read with the INTO option specified exceeds the value specified in the LENGTH option; the record is truncated, and the data area supplied in the LENGTH option is set to the actual length of the record.
13 An incorrect length is specified for a file with fixed-length records.
Default action: terminate the task abnormally.
So your easiest path forward is to look at the EIBRESP2 value and see which of these three conditions applies, and proceed accordingly.
Back to top
View user's profile Send private message
sancraig16

New User


Joined: 27 Mar 2018
Posts: 26
Location: usa

PostPosted: Wed Sep 02, 2020 9:34 pm
Reply with quote

It was the incorrect length issue. Thanks Robert !
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts CICS Question RE: Browse, Readnext an... CICS 7
No new posts Problem in READNEXT CICS 6
No new posts How to update the sequence of record ... CICS 2
No new posts RIDFLD value changes in READNEXT CICS 3
No new posts STARTBR and READNEXT problem CICS 5
Search our Forums:

Back to Top