Close considerations for files shared in a job or an activation group
Here are the considerations for closing a database file that is shared in the same job or activation group.
- The complete processing of a close operation (including releasing file, member, and record locks; forcing changes to auxiliary storage; and destroying the open data path) is done only when the last program to open the shared open data path closes it.
- If the file was opened with the Open Database File (OPNDBF) or the Open Query File (OPNQRYF) command, use the Close File (CLOF) command to close the file. The Reclaim Resources (RCLRSC) command can also be used to close a file opened by the OPNQRYF command when one of the following parameters is specified:
If one of the following parameters is specified, the file remains open even if the Reclaim Resources (RCLRSC) command is run:
- OPNSCOPE(*ACTGRPDFN), and the open is requested from the default activation group.
- TYPE(*NORMAL)
- OPNSCOPE(*ACTGRPDFN), and the open is requested from an activation group other than the default.
- OPNSCOPE(*ACTGRP)
- OPNSCOPE(*JOB)
- TYPE(*PERM)
- Example 1: A single set of files with similar processing options
You use the same set of files each time you sign on.
- Example 2: Multiple sets of files with similar processing options
You use a different set of files for each program. You normally work with one program for a considerable length of time before selecting a new program.
- Example 3: A single set of files with different processing options
You use the same set of files for programs that need read-only file processing and for programs that need some or all of the options (input, update, add, and delete).
Parent topic:
Sharing database files in the same job or activation group