View previous topic :: View next topic
|
Author |
Message |
kumar40322
New User
Joined: 25 Apr 2009 Posts: 15 Location: Hyderabad
|
|
|
|
Why we use Browse and explain the scenarios where we use ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 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. |
|
Back to top |
|
|
kumar40322
New User
Joined: 25 Apr 2009 Posts: 15 Location: Hyderabad
|
|
|
|
Hi
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? |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Random would be the better choice. Browsing would be many more commands, because you would have to -
01) STARTBR
02) READNEXT until you find the desired record
03) ENDBR saving the current key
04) READ for UPDATE
05) REWRITE
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
02) REWRITE
And you're done!
As far as dealing with errors, this should be part of your design document and implementation and is site specific.
Bill |
|
Back to top |
|
|
sajjan jindal Warnings : 1 New User
Joined: 09 Sep 2007 Posts: 60 Location: india
|
|
|
|
Yes, Bill is correct, Browse and Update are Mutually exclusive. With browse records cant be updated. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
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. |
|
Back to top |
|
|
|