Joined: 06 Jun 2008 Posts: 8339 Location: Dubuque, Iowa, USA
CICS browse operations are used when you want to read multiple records from a given starting point. For example, if the key is an alternate index with duplicates, you may need to use browse to retrieve all the matches to display on a screen (or set of screens). Another example would be address validation where, if the address is not matched exactly, you may want to display addresses on that same street to allow correction of a typo -- you would browse the file to find all the addresses to display.
If i want to updated 1500 records out of 2000 records, then which can i have to prefer whether Browse or Random read? And why?
And also if i use browse, at any point of time if there an error occurs , then how to modify it?
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
Random would be the better choice. Browsing would be many more commands, because you would have to -
02) READNEXT until you find the desired record
03) ENDBR saving the current key
04) READ for UPDATE
06) Increase the saved key value for STARTBR
07) STARTBR/READNEXT until you find the next desired record or EOF
The main problem would be the resetting of the CRP (Current Record Pointer) each time you issue an ENDBR/STARTBR combination.
Although you CAN issue a READ for UPDATE/REWRITE after a REANEXT, this is highly ill advised, due to LSR considerations, which may cause a deadly embrace (CI locks itself out recursively) as well as unnecessarily ties-up the QR TCB (which is delegating tasks as well as subsequent task work) and you don't want to do this.
Random update for each record consists of -
01) READ for UPDATE
And you're done!
As far as dealing with errors, this should be part of your design document and implementation and is site specific.
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
I don't want to stray too far from the original question, but it seems that batch, rather than online, would be more appropriate for updating 1500 records. Or maybe initiating a batch job from CICS to do the updating. Online transactions are usually intended to perform a function quickly and get out.