Reclaim Resources Command

The Reclaim Resources (RCLRSC) command depends on a system concept known as a level number. A level number is a unique value assigned by the system to certain resources you use within a job. Three level numbers are defined as follows:
Call level number
Each call stack entry is given a unique level number
Program-activation level number
Each OPM and ILE program activation is given a unique level number
Activation-group level number
Each activation group is given a unique level number

As your job runs, the system continues to assign unique level numbers for each new occurrence of the resources just described. The level numbers are assigned in increasing value. Resources with higher level numbers are created after resources with lower level numbers.

Figure 1 shows an example of using the RCLRSC command on OPM and ILE programs. Call-level scoping has been used for the open files shown in this example. When call-level scoping is used, each data management resource is given the same level numbers as the call stack entry that created that resource.

Figure 1. Reclaim Resources
Reclaim Resources

In this example, the calling sequence is programs A, B, C, and D. Programs D and C return to program B. Program B is about to use the RCLRSC command with an option of LVL(*). The RCLRSC command uses the level (LVL) parameter to clean up resources. All resources with a call-level number greater than the call-level number of the current call stack entry are cleaned up. In this example, call-level number 104 is used as the starting point. All resources greater than call-level number 104 are deleted. Note that resources in call level 200 and 201 are unaffected by RCLRSC because they are in an ILE activation group. RCLRSC works only in the default activation groups.

In addition, the storage from programs C and D and the open data path (ODP) for file F3 is closed. File F1 is shared with the ODP opened in program A. The shared ODP is closed, but file F1 remains open.