ILE COBOL Programmer's Guide

Sharing an Open Data Path to Access a File

If you have already opened a file through another program in your routing step, your ILE COBOL program can use the same Open Data Path (ODP) to access the file.

Note:
A job usually contains only one routing step. Routing steps are described in the DB2 Universal Database for AS/400 section of the Database and File Systems category in the iSeries 400 Information Center at this Web site - http://publib.boulder.ibm.com/pubs/html/as400/infocenter.htm.

The following rules apply to shared ODPs:

  1. You must specify SHARE(*YES) in the command that creates the file (CRTxxxF), in a change command (CHGxxxF), or in an override (OVRxxxF) command for the file.
  2. Once a file with a shared ODP has been opened for the first time by a program and remains open, subsequent shared OPEN operations within the same routing step run faster than standard OPEN operations. The speed of other I/O operations is not affected.
  3. Your use of the file within your different programs should be consistent. Other programs using the same shared file will affect the current file position when they perform I/O operations on the file.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]