|
View previous topic :: View next topic
|
| Author |
Message |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
| I am giving when STARTBR was successful and the key was the values which I entered through screen. And after READNEXT now what is happening is : READNEXT fetches the lowest value of the MODEL NUM(same as entered through screen) |
|
| Back to top |
|
 |
dick scherrer
Moderator Emeritus

Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Re-post your screen information using copy/paste and the "Code" tag.
Many of our contributors cannot download attachments. . .
The attachment is being removed. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Trace the code through CEDF and see what, if anything, is being done between the START BROWSE and the READNEXT. |
|
| Back to top |
|
 |
Bill O'Boyle
CICS Moderator

Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
If you have the full key value, then just issue a random READ. It's less overhead than a STARTBR then a READNEXT.
On the random READ, if you get a NOTFND, then the record doesn't exist.
A potential problem with browsing has to do with whether or not the file is defined to an LSR Pool. If it is NOT (this is known as NSR) and the browse is quite long, then control will not return to the QR (Quasi Reentrant) TCB until an explicit ENDBR (highly preferable) is issued or task termination (this is not a good idea EVER).
Many shops still lack in proper LSR Pool allocation as well as Threadsafe principles and associated coding techniques.
Note that for TS 3.2 (via an IBM PTF), Local VSAM can be made Threadsafe, but Remote VSAM remains non-Threadsafe. There's talk that TS 4.1 will acquire a Threadsafe PTF for Remote VSAM access, but I'm unsure whether this would be downward compatible.
Just my 2ยข....
Bill |
|
| Back to top |
|
 |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
R00000011381, , ,,AR55,001734,1230200
R00000011381,, , ,,AR55,001976,1230200
R00000011381, , ,,AR55,014475,1230200
R00000011381, , ,,AR55,014775,1230200
R00000011381, , ,,AR55,016295,1230200
R00000011381, , ,,AR55,016685,1230200
R00000011381, , ,,AR55,016725,1230200
R00000011381, , ,,AR55,016815,1230200
R00000011381, , ,,AR55,016825,1230200
R00000011381, , ,,AR55,017155,1230200
R00000011381, , ,,AR55,017235,1230200
R00000011381, , ,,AR55,017485,1230200
S0000005251 , , ,,AR55,018360,
S0000005251 , , ,,AR55,018400,
S0000005251 , , ,,AR55,020166,
S0000000097 , , ,,AR55,020496,
S0000000098 ,S Trans 11/26/09 , ,,AR55,020496,
R00000000269, , ,,AR55,020496,1125200
R00000000287,R Trans 11/30/09 ,CRAIG ,,AR55,020496,1130200
I am pointing the browser to AR55,020496 and after that I am giving READNEXt but what happens it goes to the AR55,001734 record.Means first record of AR55 |
|
| Back to top |
|
 |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
MOVE PRO-MODEL-NUMBER TO RLA-MODEL-NUM.
MOVE ',' TO RLA-FLD-DELI04.
MOVE PRO-SERIAL-NUMBER TO RLA-SERIAL-NUM.
MOVE PRO-MODEL-NUMBER TO WS-MODEL-PREV.
MOVE PRO-SERIAL-NUMBER TO WS-SERIAL-PREV.
EXEC CICS STARTBR
FILE ('DGCRLAP1')
RIDFLD(RLA-ALT-KEY-1)
GTEQ
RESP(WS-RESP)
NOHANDLE
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL) ,
PERFORM 1000-READ-NEXT-PARA THRU 1000-EXIT ,
UNTIL RLA-MODEL-NUM NOT = WS-MODEL-PREV AND ,
RLA-SERIAL-NUM NOT = WS-SERIAL-PREV ,
ELSE
GO TO 1000-EXIT
END-IF.
1000-READ-NEXT-PARA.
EXEC CICS READNEXT
DATASET('DGCRLAP1')
INTO(RLA-REC)
RIDFLD(RLA-ALT-KEY-1)
RESP(WS-RESP)
END-EXEC.
After this key changes to the first record which I have shown in my last post.Please suggest. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| If the code is exactly as you've posted, when the PERFORM 1000-READ-NEXT-PARA condition is completed you'll fall through the END-IF into 1000-READ-NEXT-PARA and attempt another READNEXT. |
|
| Back to top |
|
 |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
I have coded like this:-
| Code: |
IF WS-RESP = DFHRESP(NORMAL)
PERFORM 1000-READ-NEXT-PARA THRU 1000-EXIT
UNTIL RLA-MODEL-NUM NOT = WS-MODEL-PREV AND
RLA-SERIAL-NUM NOT = WS-SERIAL-PREV
GO TO 1000-EXIT
ELSE
GO TO 1000-EXIT
END-IF.
1000-READ-NEXT-PARA.
EXEC CICS READNEXT
DATASET('DGCRLAP1')
INTO(RLA-REC)
RIDFLD(RLA-ALT-KEY-1)
RESP(WS-RESP)
END-EXEC.
IF WS-RESP = DFHRESP(NORMAL)
Than some condns
and after that end-if
1000-EXIT.
EXIT.
1100-END-BROWSE.
EXEC CICS ENDBR
FILE ('DGCRLAP1')
RESP (WS-RESP)
END-EXEC.
1100-EXIT.
EXIT. |
Code'd
Please suggest where I am wrong. |
|
| Back to top |
|
 |
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
| Quote: |
IF WS-RESP = DFHRESP(NORMAL)
PERFORM 1000-READ-NEXT-PARA THRU 1000-EXIT
UNTIL RLA-MODEL-NUM NOT = WS-MODEL-PREV AND
RLA-SERIAL-NUM NOT = WS-SERIAL-PREV
GO TO 1000-EXIT
ELSE
GO TO 1000-EXIT
END-IF. |
I don't get it? after the Perform 1000-read-next-para
your logic is dropping into the 1100-end-browse
when do you move the record information to the map area ? |
|
| Back to top |
|
 |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
| I am moving while performing READNEXT PARA only. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
From the confusion of the responders and ongoing issues, I think you need to take a step back, redesign your entire program, and forget everything you have shown us. Your latest code performs 1000-READ-NEXT-PARA through 1000-EXIT until a pair of conditions are met, then branches to 1000-EXIT. At this point, since there's no PERFORM active, control will pass through the 1000-EXIT paragraph into 1100-END-BROWSE. Is that what you meant to do? We don't know. Is that possibly having an impact upon your code? Certainly it could if you still think you are browsing when the browse was ended!
I recommend you start by finding (hint: Google is your friend) a copy of Dijkstra's 1968 Communications of the ACM article entitled Go To Statement Considered Harmful, reading it, and realizing that with COBOL there is no need to use a GO TO statement. Ever. Period. GO TO statements and PERFORM statements can interact in unexpected ways in COBOL, especially when using exit paragraphs. |
|
| Back to top |
|
 |
RITESH BANSAL
New User
Joined: 27 Jan 2010 Posts: 10 Location: Bangalore
|
|
|
|
| Yes I need that only what you have explained. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|