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

End of file condition during EXEC CICS READNEXT


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

New User


Joined: 06 Jul 2005
Posts: 40

PostPosted: Thu Oct 06, 2005 4:20 pm
Reply with quote

Hi

Am trying to read a vsam-ksds file sequentially in CICS. The program is going into an infinite loop without terminating at the End of file. Basically, the end of file condition is not reached and the program is reading the last record infinite times. Program logic seems to be correct and the terminate logic is coded by checking EIBRESP for End of file condition. Please help!

Thanks in advance,
Prasad
Back to top
View user's profile Send private message
mallikiran

New User


Joined: 07 Sep 2005
Posts: 49

PostPosted: Fri Oct 07, 2005 9:07 pm
Reply with quote

Are you comparing your EIBRESP with either of DFHRESP(ENDFILE) or 20?
Back to top
View user's profile Send private message
gsnvsr

New User


Joined: 06 Jul 2005
Posts: 40

PostPosted: Thu Oct 13, 2005 2:40 pm
Reply with quote

Yes! Am comparing EIBRESP with DFHRESP(ENDFLE). Thanks!
Back to top
View user's profile Send private message
Gops

New User


Joined: 21 Jul 2005
Posts: 23

PostPosted: Wed Jun 06, 2007 1:03 pm
Reply with quote

Hi Malli kiran,

Waht will the DFHRESP code in NUMBER when a record or KEY is not found in VSAM file?

DFHRESP(NOTFOUND) or ?

Thanks,
Gops
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Wed Jun 06, 2007 1:35 pm
Reply with quote

gsnvsr wrote:
The program is going into an infinite loop without terminating at the End of file. Basically, the end of file condition is not reached and the program is reading the last record infinite times. Program logic seems to be correct and the terminate logic is coded by checking EIBRESP for End of file condition.
Either you are altering the RID field causing a reposition or the program logic is not correct.
You might try to CEDF it and see what the RID field is - if it is looping, and you cancel it, look at the expanded trace entries.
Back to top
View user's profile Send private message
Sandye

New User


Joined: 05 May 2010
Posts: 3
Location: Alabama

PostPosted: Mon Oct 18, 2010 10:27 pm
Reply with quote

did anyone figure out this problem? I am having the same issue when reading a ESDS file. I can see where the system EIBRESP = +20 but it is looking at the user EIBRESP and returning a normal response. Please help!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Oct 18, 2010 10:54 pm
Reply with quote

Hello and welcome to the forum,

Did you do as was suggested using CEDF? What was learned?
Back to top
View user's profile Send private message
Sandye

New User


Joined: 05 May 2010
Posts: 3
Location: Alabama

PostPosted: Mon Oct 18, 2010 11:07 pm
Reply with quote

Yes. The file being read in has 3 records with record length of 80 bytes. The first RIDFLD 0, next is 80, next 160. The looping continues on the last record and the RIDFLD continues to be 160.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Oct 19, 2010 12:02 am
Reply with quote

Are you beginning your READNEXT API sequences with a STARTBR API? This is mandatory, otherwise (as the fine manual will tell you) "Unpredictable Results may Occur". icon_eek.gif

I guess nobody asked this because we assumed otherwise.

FWIW, the NOTFND condition can only be raised on a sequential browse via a STARTBR API, never a READNEXT.

NOTFND (as in Key Not Found) can be raised on random (direct) READ API's.

Bill
Back to top
View user's profile Send private message
Sandye

New User


Joined: 05 May 2010
Posts: 3
Location: Alabama

PostPosted: Tue Oct 19, 2010 12:58 am
Reply with quote

I do have a STARTBR that gets a good return code. Then I perform the READNEXT.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Oct 19, 2010 1:08 am
Reply with quote

Assuming this is a non-Production region and you have the proper security, have you tried this using CECI?

Bill
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Using API Gateway from CICS program CICS 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top