CICS/Batch File Control System


If you have any questions about the content of this page, please contact CICS Requests for  clarification

The CICS/Batch File Control System is a facility through which batch jobs can  open and close CICS files. This system is intended to aid in the synchronization  of batch and online processing. VSAM as well as sequential (extrapartition and  journal) data sets are supported. Three procedures are provided:

PROCAction Performed
NWBCLOSE(CLOSE) Closes a CICS file and prevents automatic (next use) opens. May be  reversed by batch or online open.
NWBOPEN(OPEN) Makes a file "OPENABLE". This function doesn't actually open a data set,  but allows it to be opened on the next access. This function reverses a batch or  online close.
NWBRESET(RESET) Makes a file "OPENABLE". This function does not actually open a data  set, but allows it to be opened on the next access. This function does not  reverse a batch or online close. This function is not supported for sequential  data sets.

The only PARM supported by these procs is used to direct the activity to the  appropriate TEST REGION. This is accomplished by adding "TEST=TEST" to the  execution of the above procs. For example: //CLOSE EXEC NWBCLOSE,TEST=TEST

It is expected NWBCLOSE and NWBOPEN will bracket jobs that re quire exclusive  use of particular CICS data sets. Such things as BATCH updates to ON-LINE  updateable files and VSAM rreorganizationsfall into this category. NWBRESET is  intended to follow jobs that update ON-LINE read-only files. The RESET will  ensure the data in CICS VSAM buffers is as current as possible.

Automatic Reversal of Batch and Online Closes
All close commands take a file offline until 5:00 A.M. the next morning. At that  time, all VSAM and sequential data sets are be brought back online.


The ACF2 Logon ID of the batch job must have authority to signon on to CICS. In  ACF2 terms, the ID must have the CICS bit. It need not be authorized for any  CICS transactions. The ACF2 Logon ID of the batch job invoking this facility is  used for two things:

  1. Which CICS contains the files to be acted upon. ACF2 contains an institution  code which will be used to identify which production CICS should be used. May be  overridden to identify the TEST region: //S1 EXEC NWBOPEN,TEST=TEST
  2. Whether or not the batch job should be considered authorized to access the  indicated data sets. The logon ID of the batch job must be ACF2  update-authorized for the data sets being affected in CICS.

Which CICS files are to be affected (opened, closed or reset) is controlled by a  simple list of CICS FILE-ID's. For example:


And for one of the CICS test regions:


The above job streams would close CICS files NWFILE01 and NWFILE02. Any card  with a space or special character (* # $ etc.) in column 1 is considered a  comment and ignored. In all cases, characters beyond column 9 are ignored.

Error Detection and Notification

  • If, while processing a NWBCLOSE command where at least one data set cannot be  closed, a condition
           code of 8 will be returned.
  • If the logon ID is denied access to CICS, a condition code of 999 will be  returned.
  • An input list of FILE-IDs is required. An ABEND 2008 will result if omitted.
  • All other ABENDS or nasty messages should be reported to the NWRDC.

Batch Opens and Closes in a Many Step Job

 Care must be taken when in the placement of the NWBOPEN steps.
This situation came to light when a batch job inadvertently interfered with  CICS's reallocation of a VSAM file. The job was reloading a file, and when the  reload was finished, it executed a NWBOPEN step to place the file back online.  The job was not through with the data set at that time, but after the reload  step it was willing to SHARE the file with the online system. A report step ran  for another 5 minutes or so. As it turns out, the file was not actually  available to CICS until the end of the report step.

If more than one step in a job refers to the same data set, the disposition of  the data set is held between steps until the end of the last step that refers to  the data set in question.
In our case above, the disposition of NEW was held until the end of the step  that produced the report. This was true even with the DISP=SHR in that step.
Bottom line:

  • Don't execute NWBOPEN until there are no more JCL references to the dataset(s)  in question.
  • Breaking the job in two would yield the most benefit, then the report step's  DISP=SHR would then be