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

Getting EIBRESP 22 and RESP2 as 11 for ESDS in C z/Os


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Thu Jan 08, 2009 11:51 am
Reply with quote

Hi,

am using a C CICS program to read contents from ESDS VSAM
Pls find below the code snippet :

Code:
DFHEIBLK* pEIBlock;
short int BuffLen;
char* Buffer;
BuffLen        = MAX_TEXTLINE_SIZE; //equal to 256

EXEC CICS ADDRESS EIB(pEIBlock);
CurRecNum  = 0;

EXEC CICS STARTBR FILE("BTMPLOG         ")
                  RIDFLD(CurRecNum)
                  RBA;

    Buffer =
       (char*) malloc (sizeof (char) * (MAX_TEXTLINE_SIZE));
    memset (Buffer, ' ' , MAX_TEXTLINE_SIZE);

do{
EXEC CICS READNEXT INTO(Buffer)
                   LENGTH(BuffLen)
                   FILE("BTMPLOG         ")
                   RIDFLD(&CurRecNum)
                   RBA;
    memset (Buffer, ' ' , MAX_TEXTLINE_SIZE);

}while();


The above code does read operation in a sequential manner (trying to read line by line in ESDS) until it finds end of CICS file. But am getting EISRESP-22 and EIBRESP2-11 in the READNEXT when it tries to read second time, first time it reads successfully and response code = 0.

Response code =11 suggests that there is a length error but in the above code i have given 256 as buffer len and buffer allocated exactly to that size, am not able to figure out why its reporting this error (also each line in ESDS is not that long ).

Please advise.

Thanks.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jan 08, 2009 5:47 pm
Reply with quote

From the CICS Programming Reference manual (link at the top of the page) with emphasis added by me:
Quote:
LENGTH(data-area)
specifies the length, as a halfword binary value, of the data area where the record is to be put. On completion of the READNEXT command, the LENGTH parameter contains the actual length of the record.
So the question becomes, where do you set BuffLen back to 256 after the first read? If the second record is longer than the first, you would very definitely get RESP=22, RESP2=11 on a READNEXT.
Back to top
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Thu Jan 08, 2009 8:28 pm
Reply with quote

You are CORRECT. Very bad of me should have gone thorough the manuals. Thanks very much it works for me now.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Thu Jan 08, 2009 8:35 pm
Reply with quote

Glad to hear it's working.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts VSAM ESDS File to store large data 4GB JCL & VSAM 5
No new posts RPLDDDD field for extended VSAM - ESDS JCL & VSAM 1
No new posts EIBRESP=16 and EIBRESP2=25 while doi... CICS 2
No new posts EIBRESP =16 & EIBRESP2 = 01 while... CICS 3
Search our Forums:

Back to Top