View previous topic :: View next topic
|
Author |
Message |
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
Hi,
I have a program which has the following structure :-
1. StartBR a file
2. Readnext until I get the record I want or EOF.
3. EndBR the file
I call this routine 2wice. The second time I do the StartBR, it fails with EIBRESP = 10.
Dont know why the StartBR fails when I have done a EndBR the last time I used the file.
Please reply ASAP.
Cheers. |
|
Back to top |
|
|
iknow
Active User
Joined: 22 Aug 2005 Posts: 411 Location: Colarado, US
|
|
|
|
Hi murali922,
To my understanding I think the reason why STARTBR fails is due to the illogic condition.
Consider this problem scenario.
Question
Quote: |
I have a couple of development questions concerning CICS and a ESDS file.
I am writing a background CICS program that will start and the beginning of
an ESDS file and read, process until it reaches the end of the file. When
I reach the EOF, I put the program to sleep (the CICS delay command) for 30
seconds, giving the users some time to add more data to the end of the ESDS
file. I'm having 2 issues.
I will browse the ESDS file in fileaid and see that there are xx records on
the file. When I run my program in expediter, I can read until the end of
the file, but it may be at the yy record. Is the program reading data out
of the ESDS buffer before it was physically written to the buffer? Also,
when the program wakes up after it's nap, I want to start a browse again at
the RBA that is equal to the last record on the file. I can calculate the
RBA of the last record since the records are fixed length. When the
startbr is executed, I am getting a resp of 21 and a resp2 of 110. In
other words the startbr fails with an illogic condition. I can reset the
RBA to zero and the startbr works just fine. What am I missing? |
Answer
Quote: |
First issue: Yes, non CICS reads see only the physical disk data while CICS
reads see the buffer.
Second issue: With each READNEXT yoou will get the RBA in the RIDFLD, save it for the STARTBR when you next wake up and READNEXT one extra time to get past the already read record. |
Try to figure out the logic, the way you have coded your program.
Hope this helps. |
|
Back to top |
|
|
murali922
New User
Joined: 25 Jul 2005 Posts: 92 Location: India
|
|
|
|
Mine is a KSDS file.
Why is a STARTBR failing in this case, when I have ENDBR the same ?? |
|
Back to top |
|
|
satsubram
New User
Joined: 18 May 2006 Posts: 1
|
|
|
|
I have the same issue with STARTBR issued two times. Did you have a resolution for your problem. Please help.
Thanks in advance. |
|
Back to top |
|
|
gskulkarni
New User
Joined: 01 Mar 2006 Posts: 70
|
|
|
|
Guys, i might be able to help. Could you post your code and RESP and RESP2 values please? |
|
Back to top |
|
|
gskulkarni
New User
Joined: 01 Mar 2006 Posts: 70
|
|
|
|
START=>READNEXT in loop => ENDBR => Reset the STARTBR keyf => STARTBR
This flow should work perfectly fine if the response code of each of them was 0.
You have said response code is 10. But in case of STARTBR you generally do not get resp code = 10. It must be 104, 110 or something like it. Please post the exact RESP and RESP2. Also check the RESP and RESP2 of the last ENDBR.
Although conceptually since you are dealing with the same file again, i.e. browsing the same file in loop, you should be using RESETBR command instead of ENDBR. RESETBR is equal to STARTBR with new key without ending the browse. |
|
Back to top |
|
|
karthick sivakumar
New User
Joined: 16 Mar 2006 Posts: 16 Location: india
|
|
|
|
Hi,
if u are reading a ksds it is enough to give start browse only once .
then in the readnext handle the condition eof. loop until eof is set( loop the read next alone).
finally use end browse(optional). this should work fine i guess
see the example code
EXEC CICS STARTBR DATASET('DATASET')
RIDFLD(KEY)
EQUAL / GTEQ
END-EXEC
PERFORM X100-READNEXT THRU X100-EXIT UNTIL EOF
X100-READNEXT.
EXEC CICS HANDLE CONDITION ENDFILE(X110-END-FILE)
END-EXEC.
EXEC CICS READNEXT DATASET('DATASET')
INTO(WS-RECORD)
RIDFLD(KEY)
END-EXEC.
X110-END-FILE.
SET EOF TO TRUE.
X100-EXIT. |
|
Back to top |
|
|
|