Using the ASYNC Jobs (MBJC)

ASYNC (background) jobs are used to process the non-time sensitive table updates, such as analysis and reporting updates, associated with transactions that are processed throughout the day in the following modules: Order Entry, Order Maintenance, Purchase Order Maintenance, Purchase Order Receiving, and Billing.

ASYNC jobs are used to process these updates for the following reasons:

• System response time would be affected if all table updates associated with each system transaction were processed interactively.

• Table updates can occur more quickly by dynamically updating the tables through out the day rather than running an end of day batch process.

• Analysis information can be viewed and reported more quickly.

Example: When new orders are entered onto the system, the order records are created interactively, and if desired, inventory can be reserved for the order. The order can be maintained, viewed, and is eligible for shipment as soon as it is entered.

The marketing information associated with the order is updated via the Order Processing ASYNC function. These table updates occur throughout the day as the records are sent to the data queue associated with the Order Processing ASYNC function.

ASYNC processing allows you to quickly update the tables necessary to create and ship the order, and eliminates the need to run a batch process at the end of the day to update all of the system tables associated with recording the order.

The following ASYNC jobs are used:

ASYNC Job

Function

CNTL_ASYNC

Starts and ends all of the ASYNC jobs. See Starting the ASYNC Jobs and Ending the ASYNC Jobs.

BILL_ASYNC

Updates system tables as orders are billed.

EBO_ASYNC

Performs reservation for backordered items when inventory levels for an item change.

ORDR_ASYNC

Updates system tables as orders are entered and maintained.

OTHR_ASYNC

Updates system tables as purchase orders are entered, maintained, and received.

In this chapter:

Running the ASYNC (Background) Jobs

- Starting the ASYNC Jobs

- Processing Transactions

- Ending the ASYNC Jobs

- ASYNC Job Status Codes

Running the ASYNC (Background) Jobs

Purpose: The ASYNC jobs, or background jobs, are used to process system table updates throughout the day. These jobs run in the background and process transactions in sequence as they are sent to the data queues. These jobs are placed in a Wait (DEQW) status when there are no records to process.

Starting the ASYNC Jobs

The following ASYNC jobs must be running to process the records in the data queue tables. The controlling ASYNC job (CNTL_ASYNC) is used to start the ASYNC jobs.

• BILL_ASYNC

• EBO_ASYNC

• OTHR_ASYNC

Note: The ORDR_ASYNC job updates system tables with order and demand information as orders are entered and maintained. As you enter or maintain orders, the system sends the records to the Order Processing data queue for processing. As soon as the Order Processing Data queue receives a record to process, the record is processed immediately, regardless of the status of the Order Processing ASYNC (ORDR_ASYNC) job. The ORDR_ASYNC job processes multiple orders simultaneously. While the Order Async job does not need to be active to process records, you should set the Order Async job to active to handle reorganization and cleanup of any transactions that did not process correctly.

If you start the ASYNC jobs and the ASYNC subsystem is not running, the status of the CNTL_ASYNC job will be *JOBQ. The status will change to *ACTIVE as soon as the ASYNC subsystem is up.

Scheduling when the Async Jobs Start: You can create a schedule for a periodic process that contains the STRASYN periodic function to start asyncs.

Function

Description

Program

Summary

STRASYN

Start asyncs

MSSTRASYNC

If the asyncs are currently Inactive, this periodic function calls the Controlling Data Queue (CNTL_ASYNC) in Background Job Control (MBJC) and starts the background jobs.

This periodic function performs the same updates as selecting Start for the CNTL_ASYNC to start the background jobs. See Starting the Background ASYNC Jobs.

For more information:

• See Working with Periodic Processes (WPPR) for information on how to assign each function to a periodic process.

• See Executing Periodic Processes (EPRO) for more information on scheduling a periodic process to run at a specified time.

Processing Transactions

As transactions are processed on the system, records are sent to the data queues. The records are processed one-by-one in the sequence in which they were sent to the data queue. A separate data queue is used for each ASYNC job.

The status of each data queue record can be viewed at any point by displaying the data queue associated with the ASYNC job.

Errors: If an error occurs as a record is being processed, the system stops processing the record at the error point, and moves on to the next record in sequence for processing.

The records in error remain on the system until the error is corrected and processing can be fully completed. The errors are listed on the error reports that print when the ASYNC jobs are ended. A separate error report is printed for each ASYNC job.

Processing errors occur when a table associated with the transaction cannot be updated. This usually occurs because the system is attempting to update a record that no longer exists.

Example: If the Source Code record associated with an order is deleted before the order is billed, an error will occur during BILL_ASYNC.

Status of async jobs: When the Async jobs are active, the system checks the status of each async job under Job Management (My Jobs). If the async job is active and the job status is not RUN, the next time the system checks the status of the async jobs, the system automatically updates the job status to RUN. For example, if the Order Async is Active and you change the ORDR_ASYNC job to END, the system will automatically change the status of the ORDR_ASYNC job back to RUN. If you wish to start or stop the Async jobs, you must start or stop the Controlling Async job in the Background Job Control (MBJC) menu option.

Ending the ASYNC Jobs

The ASYNC jobs must be ended to clear the completed records from the data queue tables and to print the error reports. The controlling ASYNC job (CNTL_ASYNC) is used to end all of the ASYNC jobs.

The ASYNC jobs should be ended once per day so that the data queues can be deleted and any errors can be corrected in a timely manner. If you do not bring these jobs down regularly:

• completed records in the data queues will not be deleted and the data queue tables will become quite large

• the 'shut down' process will take longer

• errors will be more difficult to correct.

In addition, if the ASYNC subsystem is ended while the ASYNC jobs are active, these jobs will end abnormally; the status of each background job will remain in a *ACTIVE status even though they are not running. You will have to change the status of each job to *INACTIVE to restart the ASYNC jobs.

Scheduling when the Async Jobs End: You can create a schedule for a periodic process that contains the ENDASYN periodic function to end asyncs.

Function

Description

Program

Summary

ENDASYN

End asyncs

MSENDASYNC

If the asyncs are currently Active, this periodic function calls the Controlling Data Queue (CNTL_ASYNC) in Background Job Control (MBJC) and ends the background jobs.

This periodic function performs the same updates as selecting End for the controlling data queue to end the background jobs; however, any records in the data queue will be processed when the background ASYNC jobs are restarted. See Ending the Background ASYNC Jobs for more information on the updates that are performed.

For more information:

• See Working with Periodic Processes (WPPR) for information on how to assign each function to a periodic process.

• See Executing Periodic Processes (EPRO) for more information on scheduling a periodic process to run at a specified time.

When the ASYNC jobs are ended:

• If you manually end asyncs, a terminator record is sent to each data queue to identify the last record to be processed. Records sent to the data queue before the terminator record will be processed; records sent to the data queue after the terminator record was sent will be processed when the background ASYNC jobs are restarted.

• If you use the ENDASYN periodic function to end asyncs, any records in the data queue will be processed when the background ASYNC jobs are restarted.

• The data queue will be reorganized. All completed records will be deleted from the data queue tables.

• An error report listing all of the records that could not be processed, and the reason for the error, will be printed. A separate error report will print for each ASYNC job.

• The status of the ASYNC jobs will change to *INACTIVE

Active procedures: When you end the ASYNC jobs manually, the Active Procedure table is checked to see if there are users in any of the following functions:

• Order Entry

• Order Maintenance

• Purchase Order Maintenance

• Purchase Order Receiving

• Confirmation

• PC Manifest

If an Active Procedures record exists for any of these functions, the ASYNC jobs cannot be ended. A pop-up window displays showing the User ID and the function where the user is active. The user must exit the application before the ASYNC jobs can be ended.

If the user ended the application abnormally, the Active Procedures record may be 'stranded' (e.g., the record is active even though the user has exited the application). In this situation, you must delete the Active Procedures record using Purging Active Procedures (MACP) or Purge Active Procedures Across Users (MACX). You can also purge active procedures for interactive jobs that are older than a specified number of hours using the DLTACPR Delete Stranded Active Procedures periodic function.

Note: If you have created a periodic process to schedule when the job scheduler ends the ASYNC jobs, the job scheduler does not look for any active procedures and instead, immediately ends the asyncs.

ASYNC Job Status Codes

Status

Description

*ACTIVE

The ASYNC job is up and running.

*INACTIVE

The ASYNC job is not running.

*JOBQ

The ASYNC job has been submitted to the job queue for start-up. The ASYNC jobs are in a *JOBQ status only when the ASYNC subsystem has not been started.

*ENDPEND

The ASYNC job is in the process of ending.

*REORG

Completed records processed by the ASYNC job are being deleted from the tables.

SO01_01 OROMS 17.0 2018 OTN