Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Getting EIBRESP 22 and RESP2 as 11 for ESDS in C z/Os
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: 7936
Location: Bellevue, IA

PostPosted: Thu Jan 08, 2009 5:47 pm    Post subject:
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    Post subject: Reply to: Getting EIBRESP 22 and RESP2 as 11 for ESDS in C z
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: 7936
Location: Bellevue, IA

PostPosted: Thu Jan 08, 2009 8:35 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts EIBRESP 13 on Alternate Index amitc23 CICS 7 Wed Feb 18, 2015 6:33 pm
No new posts How do I get the Response from EIBRESP Robert.Barnes COBOL Programming 1 Sat Oct 25, 2014 9:21 am
No new posts eibresp = 16 and eibresp2 = 28. abhishek chhawcharia CICS 1 Fri Apr 25, 2014 9:37 pm
No new posts CICS eibresp 22 while reading VSAM Fi... abhishek chhawcharia CICS 18 Tue Apr 22, 2014 1:38 am
No new posts CICS EIBRESP 22 and EIBRESP2 13 picus_mf CICS 2 Thu Nov 14, 2013 6:19 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us