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
 

 

STARTBR and DELETE in CICS

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

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed May 12, 2010 7:54 pm    Post subject: STARTBR and DELETE in CICS
Reply with quote

Hi ,

I have a requirement , where i need to keep reading a VSAM (KSDS) sequentially and check for a condition , if the read record satisfies the condition i need to remove the record from the VSAM and continue with the Next record , If i reach the End of FIle , i will issue a delay restart and repeat the whole process again.


My Doubts :
I do a STARTBR and use read next to do the sequential read.
Now can i delete the record simply by using the key and continue with readnext , or
should i issue a ENDBR and store the Key and DELETE and then again STARTBR using the key and continue

Please advice
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8057
Location: East Dubuque, Illinois, USA

PostPosted: Wed May 12, 2010 8:20 pm    Post subject:
Reply with quote

From the CICS Programming Guide manual (link at the top of the page), section 4.2.1.2:
Quote:
To end the browse, use the ENDBR command. There is no RIDFLD for this command. Trying to browse past the last record in a file raises the ENDFILE condition. You must issue the ENDBR command before performing an update operation on the same file (a READ UPDATE, DELETE with RIDFLD, or WRITE command). If you do not, you get unpredictable results, possibly including deadlock within your own transaction.
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 May 12, 2010 8:33 pm    Post subject: Reply to: STARTBR and DELETE in CICS
Reply with quote

If the file is defined to LSR and you issue a STARTBR, READNEXT and then a DELETE before issuing an ENDBR, you're going to have big trouble, as the CRP (Current Record Pointer) will lose its mind and/or (as Robert has posted from the IBM manual), cause a deadlock.

Besides, IBM highly discourages this sequence.

I first encountered a program in the mid 1980's which was doing this (we were running CICS/OS 1.6.1 at the time) and it was a royal PITA to debug.

So, don't do this....

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

Active User


Joined: 31 Jul 2007
Posts: 136
Location: india

PostPosted: Wed May 12, 2010 8:44 pm    Post subject:
Reply with quote

Thank you all
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 CICS Transaction Timeout Hooman24 CICS 2 Sun Apr 16, 2017 2:16 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm
No new posts Asynchronous CICS Processing Question moezbud CICS 1 Mon Mar 06, 2017 6:13 pm
No new posts CICS Question RE: Browse, Readnext an... moezbud CICS 7 Sun Mar 05, 2017 5:45 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm


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