Using the SETBRCUR, REPBRCUR and DELBRCUR options for log stream processing

SETBRCUR, REPBRCUR and DELBRCUR are the recommended options for log stream offline processing.

About this task

Using these options ensures that the beginning and end of your read are precisely defined, and the reads are repeatable. For example, using the REPBRCUR option enables you to archive the same records in two different formats. These options also provide enhanced support for automatic logstream processing, as you do not need to include date and time information in your batch program. Note that log streams to be processed in this way should be defined as AUTODELETE(NO) RETPD(0), to avoid unexpected loss of data.

It is recommended that you should not run more than one job per logstream using a SETBRCUR, REPBRCUR or DELBRCUR option at any one time in your sysplex. If you run more than one such job simultaneously, they could update the same cursor, and then your reads would not be repeatable. You should also not run a job using LASTRUN at the same time as a job using SETBRCUR, REPBRCUR or DELBRCUR. You can run jobs that use only non-cursor related options at the same time as a job using one of the cursor-related options (SETBRCUR, REPBRCUR, DELBRCUR and LASTRUN), as the other log stream processing options do not affect the position of the cursors.

A suggested sequence for using the SETBRCUR, REPBRCUR and DELBRCUR options for log stream processing is as follows:

Procedure

  1. Run a job using the SETBRCUR option, to read a set of records and then set the browsed cursor at the last record read.
  2. If the job fails, you can repeat the job using the SETBRCUR option.
  3. If you want to re-read the same set of records, for example to produce the same records in different formats, run a job using the REPBRCUR option. This option does not change the position of any cursors.
  4. If the job fails or you want to re-read the same set of records again, you can repeat the job using the REPBRCUR option.
  5. If you want to repeat the whole reading process thus far for any reason, you can now start again at Step 1. If you restart the process, any new data that has been placed on the log stream can be picked up.
  6. If the reading process has been successful and you are certain that you no longer need the records that you have read, run a job using the DELBRCUR option, to delete the records that you have processed and then set the deleted cursor at the end of the records you have just deleted.
  7. If the job fails, you can repeat the job using the DELBRCUR option.
  8. You have now processed a set of records and deleted them from the log stream.

Example

The following flowchart illustrates this sequence of actions:
Figure 1. Log stream processing using SETBRCUR, REPBRCUR and DELBRCUR
This figure is explained in full by the text above.

For an example of how you can use SETBRCUR and REPBRCUR to make two copies of the same log stream partition, then delete the log stream partition using DELBRCUR, see Examples of using DFHJUP.