Handling Prerequisite Resources for a Job

#### Search Results

Search

# Handling Prerequisite Resources for a Job

The functions described in this section are used to list and define single or multiple resources for a job that are a prerequisite for submitting the job.

This document covers the following topics:

- Use of Resources and Resource Allocation

- Listing Prerequisite Resources Defined for a Job

- Viewing the Usage of a Prerequisite Resource

- Displaying, Modifying and Adding a Prerequisite Resource Definition

- Columns and Fields: Prerequisite Resource Definitions

- Deleting a Prerequisite Resource Definition

#### Related Topics:

- Resources (maintenance of resource masters) - Administration documentation

- Viewing and Modifying Resources Used by Active Jobs - Active Job Networks

## Use of Resources and Resource Allocation

You can specify certain amounts of a defined resource master as a prerequisite for job submission. Entire Operations does not submit the job until the specified amount is available.

Before you can define a resource as a prerequisite for a job, it must be defined as resource master to Entire Operations. You define resources to Entire Operations by using the Resources maintenance functions described in the Administration documentation.

Resources can be

- Quantitative or absolute;

- Reusable or not reusable.

Some examples of resources are listed below:

Resource | Type
--- | ---
Print forms | Quantitative, not reusable
Main storage | Quantitative, reusable
Line to a remote machine | Absolute
Availability of a device | Absolute

This section covers the following topics

- Scope of Resource Allocation

- Ordering of Resource Allocation

- Resource Amount Determination by User Exits

- Periods of Resource Allocation and Deallocation

- Resource Allocation Modes

- Resource Deallocation Modes

### Scope of Resource Allocation

Prerequisite resources are allocated for all job types (including `DUM`) and for all kinds of temporary dummy jobs. You can set an allocation mode to disallow resource allocation for temporary dummy jobs.

### Ordering of Resource Allocation

The following rules apply for the ordering of resource allocations:

1. If a resource is requested by the same owner, network, job, but different runs (at the same time), the active job with the lowest run number or earliest activation time will get the resource first.

2. If several different jobs of one active network or of several active networks wait for the same resource: The available quantity of the resource will be allocated to as many as possible jobs in parallel, but under the restriction of item 1.

If a resource waiter with a higher priority is found during a prerequisite resource check, the message `Res. resource available, other jobs have priority` will be written to the log. It is followed by `Res. resource - waiting with higher priority`: and one or several lines with context information.

### Resource Amount Determination by User Exits

The available amount of a resource can be determined by the usage of an exit. A resource master determination exit (described in the Administration documentation) will be invoked by the Entire Operations Monitor before prerequisite resource checks.

Resource master amounts can be modified by API calls. Note that this is possible only if the amount is not determined by a resource master determination exit. For more information, see Handling of Resource Allocations (NOPURE2N) in the section List of Available Entire Operations API Routines.

### Periods of Resource Allocation and Deallocation

A resource is usually allocated for the duration of job execution.

If you want to allocate a resource for a longer time, you can change the resource deallocation mode set for a job as described in Resource Deallocation Modes.

The reasons and rules for resource allocation or deallocation are described in the following section:

- Retention period of condition reached

  A resource is deallocated if the retention period for an active condition is reached.

- Deallocation mode set

  If you want to allocate a resource for a longer time, you can change the resource deallocation mode set for a job as described in Resource Deallocation Modes.

- Deactivated network or job

  If an active network or job is deactivated, all resources allocated by it are deallocated too.

  This is performed regardless of the defined deallocation mode.

  This means that even resources with deallocation mode `K` (keep until explicit release) are released in such cases.

- Database cleanup performed

  Resources are deallocated when an automatic cleanup of the active database is performed (see also Default Setting (2) described in the Administration documentation).

- Allocation kept for jobs that ended not ok

  It is possible to prevent a resource from deallocation if a job ended `not ok`. This can be used, for example, to keep a resource during a recovery for an unsuccessful run.

  See the field Deallocate if Job not ok in the Prerequisite Resource Definition (Master) window described in Columns and Fields: Prerequisite Resource Definitions in the section Job Maintenance.

- Forced deallocation

  You can force freeing of a resource allocation.

  All current resource allocations can be inquired in usage lists. From these active resource usage lists it is possible to force the deallocation of a given resource allocation.

  For further information, see Listing Jobs Currently Using a Resource in the section Resources in the Administration documentation.

  Use this feature with care. Be aware that one or several active jobs may be started immediately, which were way for this resource.

- Allocation or deallocation determined by API

  Resources can be allocated for a job by an API call. These additionally allocated resources are handled in the same way as defined prerequisite resources.

  Resources can be deallocated by API calls. Preliminary releases of resources are allowed for deallocation modes.

  For more information, see Handling of Resource Allocations (NOPURE2N) in the section List of Available Entire Operations API Routines.

All resource allocations and deallocations are logged (see also the section Log Information).

### Resource Allocation Modes

This section describes the resource allocation modes that can be set for the prerequisite resource defined for a job (see also Displaying, Modifying and Adding a Prerequisite Resource Definition). Allocation modes are also indicated on resource lists.

Mode/Input Value | Explanation
--- | ---
`A` | Allocate the resource (default).
`T` | Do not allocate the resource if the job executes as a temporary dummy job.

### Resource Deallocation Modes

This section describes the resource deallocation modes that can be set for the prerequisite resource defined for a job (see also Displaying, Modifying and Adding a Prerequisite Resource Definition). Deallocation modes are also indicated on resource lists.

Mode/Input Value | Explanation
--- | ---
`J` | Release resource at job termination (default). The resource is released when the allocating job terminates.
`N` | Release resource at network termination. The resource is released when the Entire Operations Monitor detects that all jobs of a job network are terminated. The resource is released also if a currently executing network is being deactivated. Note To override the automatic detection of `network ended ok`, you must set the reserved condition `NET-END-OK` at least once in your network.
`E` | Release resource at network termination, but release earlier after an erroneous job. The resource is kept until network termination. If any job ends `not ok`, it is released immediately after this job's termination.
`K` | Keep resource until manual release. The resource is not released automatically at job or network termination. If the retention period for active conditions is reached, the resource is released automatically.

## Listing Prerequisite Resources Defined for a Job

To list prerequisite resources specified for a job

1. On the Job Maintenance screen, enter `L` in the line command input field next to the required job.

2. Press ENTER.

   A Prerequisite Resources (Master) screen like the example below opens:

                                Prerequisite Resources (Master)
        ------------------------------------------------------------------------------
        Owner EXAMPLE    Network B60-FLOW   Version                 Job JOB-06
        Run from       to                            required
        Cmd  Run Job        Resource             T   Quantity  A D DNO   allocated
        _                   HUGO                 R       5.00  A J  Y
        _                   PARA-1               R      10.00  A N  Y
        _                   WILLI                U   10000.00  A K  N

        ******************************* Bottom of Data *******************************
        B Browse   D Delete   M Modify   R Master Definition   W Where Used

       Enter--PF1----PF2----PF3----PF5---------PF7----PF8-----------------------------
              Help   Add    End    Save        Up     Down

   The screen lists all resources specified for the job as prerequisites. The columns contained in the window are described in Columns and Fields: Prerequisite Resource Definitions.

## Viewing the Usage of a Prerequisite Resource

To find out where a predefined resource is used

1. In the Cmd column of the Prerequisite Resources screen, enter the line command `W` (Where Used) next to the required resource.

2. Press ENTER.

   A Resource defined in Jobs window opens with a list of all owners, networks and jobs that use the selected resource.

   If invoked for a job master definition: Shows the usage of this resource as a prerequisite in all job master definitions.

   If invoked for an active job definition: Shows the current usage of this resource by active jobs.

   The fields and columns contained in the window correspond are described in Field and Columns: Resource Defined in Jobs in the section Resources in the Administration documentation.

## Displaying, Modifying and Adding a Prerequisite Resource Definition

To display or modify the prerequisite resource definition of a job

1. On the Prerequisite Resources screen, type `B` (Browse) in the line command input field next to the resource you want to display in read-only mode.

   Or:
   In the Prerequisite Resources screen, type `M` (Modify) in the line command input field next to the resource you want to modify.

2. Press ENTER.

   A Prerequisite Resource Definition (Master) window like the example below opens:

       +-------------------------------------------------------+
       |                                                       |
       |      Prerequisite Resource Definition (Master)        |
       |                                                       |
       |           Resource ===> HUGO________________          |
       |  Required Quantity ===> 5.00______                    |
       |                                                       |
       |           Allocation Mode ===> A                      |
       |         Deallocation Mode ===> J                      |
       |  Deallocate if Job not ok ===> Y                      |
       |                 Allocated ===>                        |
       |                                                       |
       |  Enter-PF1---------PF3---------PF5----------------    |
       |        Help        End         Save                   |
       +-------------------------------------------------------+

   The fields are described in Columns and Fields: Prerequisite Resource Definitions.

To add a prerequisite resource definition for a job

- In the Prerequisite Resources list screen, choose PF2 (Add).

  A Prerequisite Resource Definition window opens.

  The input fields and options available in the window are described in Columns and Fields: Prerequisite Resource Definitions.

## Columns and Fields: Prerequisite Resource Definitions

The following table explains the columns contained on the Prerequisite Resources list screen and the corresponding input fields (if available) of the Prerequisite Resource Definition window.

Column | Input Field | Description
--- | --- | ---
Cmd | n/a | One-character line command input field for a selected prerequisite resource definition listed on the screen. Possible commands are:
`B` | Display the prerequisite resource in read-only mode.
`D` | Delete the prerequisite resource for this job.
`M` | Modify the prerequisite resource for this job.
`R` | Display the resource master definition.
`W` | View where the resource is used.
Resource | Resource | Name of the resource as defined in Entire Operations and listed on the Resources screen (see Resources in the Administration documentation). Input field: You can use a wildcard (`*`) to select a name from a list of available resources.
T | n/a | Resource type as defined for the resource master: see the description of the Type field in the section Resources (Administration documentation).
required Quantity | Required Quantity | Resource quantity required for job execution. Input field: Enter the resource quantity required for job execution. The required quantity must be greater than or equal to zero. A required quantity that equals zero has the same effect as if the prerequisite resource would not be defined. Entire Operations does not submit the job until this amount of resource is available.
A | Allocation Mode | Allocation mode of this prerequisite resource: see Resource Allocation Modes.
D | Deallocation Mode | Deallocation mode of this prerequisite resource: see Resource Deallocation Modes.
DNO | Deallocate if Job not ok | Applies to deallocation mode `J` only. Deallocate if job is `not ok`:
`Y` | The resource is always deallocated after job termination, even if the job ended `not ok`.
`N` | The resource is not deallocated if the job ended `not ok`. (However, the job will still be deallocated at network termination.)
Input option: Enter `Y` or `N` as required.
Allocated | Allocated | Applies to active prerequisite resources only. Date and time when the resource was allocated for the current job. If the resource has not yet been allocated or if it has already been deallocated, this field is empty. See also Date and Time Formats.

## Deleting a Prerequisite Resource Definition

To delete a prerequisite resource

1. In the Prerequisite Resources screen, type `D` (Delete) in the line command input field next to the resource you want to remove.

2. Press ENTER.

   The selected resource is deleted for this job master.

### On this page

- Use of Resources and Resource Allocation
- Listing Prerequisite Resources Defined for a Job
- Viewing the Usage of a Prerequisite Resource
- Displaying, Modifying and Adding a Prerequisite Resource Definition
- Columns and Fields: Prerequisite Resource Definitions
- Deleting a Prerequisite Resource Definition