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
 

 

Given READNEXT COMMAND But error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Wed Feb 10, 2010 11:03 pm    Post subject: Given READNEXT COMMAND But error
Reply with quote

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
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Wed Feb 10, 2010 11:18 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Wed Feb 10, 2010 11:32 pm    Post subject:
Reply with quote

Trace the code through CEDF and see what, if anything, is being done between the START BROWSE and the READNEXT.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Feb 10, 2010 11:43 pm    Post subject: Reply to: Given READNEXT COMMAND But error
Reply with quote

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
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Thu Feb 11, 2010 12:17 pm    Post subject:
Reply with quote

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
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Thu Feb 11, 2010 12:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Thu Feb 11, 2010 5:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Thu Feb 11, 2010 6:59 pm    Post subject: Reply to: Given READNEXT COMMAND But error
Reply with quote

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
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Fri Feb 12, 2010 9:04 am    Post subject:
Reply with quote

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
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Fri Feb 12, 2010 8:36 pm    Post subject:
Reply with quote

I am moving while performing READNEXT PARA only.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7909
Location: Bellevue, IA

PostPosted: Fri Feb 12, 2010 8:50 pm    Post subject:
Reply with quote

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
View user's profile Send private message
RITESH BANSAL

New User


Joined: 27 Jan 2010
Posts: 10
Location: Bangalore

PostPosted: Fri Feb 12, 2010 9:05 pm    Post subject:
Reply with quote

Yes I need that only what you have explained.
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


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