Working with the CNTL_ASYNC Job

The controlling ASYNC job (CNTL_ASYNC) is used to start and end each of the background ASYNC jobs. When you start the CNTL_ASYNC job, all of the background ASYNC jobs start; when you end the CNTL_ASYNC job, all of the background ASYNC jobs end. You cannot start or end an individual background ASYNC job.

You should end the CNTL_ASYNC job each day, when your operations for the day are complete. When you end the CNTL_ASYNC job:

         Records that were processed successfully for each background ASYNC job are deleted from the data queue tables.

         An error list is produced for each background ASYNC job.

Ending the background ASYNC jobs allows you to delete unnecessary records from the system, and enables you to correct any processing errors in a timely manner.

In this topic:

         Work with Background Jobs Screen

         Display Asynchronous Job Screen (Displaying the CNTL_ASYNC Job)

         Starting the Background ASYNC Jobs

         Starting the Background ASYNC jobs

         Ending the Background ASYNC Jobs

         Display Active Procedure Window

         Reorganizing the ASYNC Job Data Queues

         Troubleshooting the Async Jobs

         Determining the Status of the Async Jobs

         Verifying the Status of the Async Jobs

         Running the JOBCLN Periodic Function to Correct the Async Jobs

         Reviewing the Async Job Log

Work with Background Jobs Screen

Purpose: This screen displays the current status of each background ASYNC job. This screen is used to start or end the ASYNC jobs, to display the records in the data queue associated with each job, or to reorganize the data queues.

All of the options on this screen can be used with the Controlling ASYNC (CNTL_ASYNC) job.

How to display this screen: Enter MBJC in the Fast path field at the top of any menu or select Background Job Control from a menu.

Field

Description

Job name

The name of the ASYNC job.

The ASYNC jobs are:

         BILL_ASYNC = Billing background job

         CNTL_ASYNC = Controlling background job

         EBO_ASYNC = Evaluate backorders background job

         ORDR_ASYNC = Order processing background job

         OTHR_ASYNC = Other background job purchase orders)

Alphanumeric, 10 positions; optional.

Description

The description of the data queue associated with the ASYNC function.

Alphanumeric, 40 positions; optional.

Status

The status of the ASYNC job.

Valid status codes are:

         *ACTIVE = the ASYNC function is running

         *INACTIVE = the ASYNC function has ended

         *JOBQ = the ASYNC function has been submitted to the job queue for startup

         *Endpend = the ASYNC function is in the process of ending

         *Reorg = the data queue associated with the ASYNC function is being reorganized

Alphanumeric, 10 positions; display-only.

Control

A code indicating whether the ASYNC function is a controlling function.  The controlling function is used to start, end, and reorganize the data queues for the ASYNC functions it controls.  Currently, the CNTL_ASYNC function is the only controlling function.  

Valid codes are:

         Y = the ASYNC function is a controlling function

         N = the ASYNC function is not a controlling function.

Note:             In order to perform certain options at the Work with Background Jobs screen, you need to have the Security administrator flag for the user selected. See User Configuration in the Administration Guide for more information.

Screen Option

Procedure

Display the attributes of an ASYNC job

Select Display for an ASYNC job to advance to the Display Asynchronous Job Screen (Displaying the CNTL_ASYNC Job).

Start the background ASYNC jobs

Select Start for the CNTL_ ASYNC job to start all of the ASYNC jobs.   See Starting the Background ASYNC Jobs.

End the background ASYNC jobs

Select End for the CNTL_ ASYNC job to end all of the ASYNC jobs. See Ending the Background ASYNC Jobs.

Reorganize the data queue for a background ASYNC job

Select Reorganize queue for the CNTL_ ASYNC job to reorganize the data queues associated with each   ASYNC job. See Reorganizing the ASYNC Job Data Queues.

Display the data queue for an ASYNC job

Select Display Data queue for an ASYNC job.

Display Data queue cannot be used with the CNTL_ASYNC.

Work with Drop Ship background jobs

Select Drop Ship Jobs to advance to the Work with Drop Ship Background Jobs Screen.

Work with integration layer jobs

Select Integration Layer to advance to the Work with Integration Layer Process Screen.

Display Asynchronous Job Screen (Displaying the CNTL_ASYNC Job)

Purpose: Use this screen to display descriptive information about an ASYNC job such as the CNTL_ASYNC job.

How to display this screen: Select Display for a job at the Work with Background Jobs Screen.

Field

Description

Process name

The name of the process for this ASYNC job. Listed as the Workstation for the ASYNC job at the screen in Purge Active Procedures Across Users (MACX).

The data queues are:

         CNTL_ASYNC = CNTRLDATAQ

         BILL_ASYNC = BILLDATAQ

         EBO_ASYNC = EVLBODATAQ

         ORDR_ASYNC = ORDERDATAQ

         OTHR_ASYNC = OTHERDATAQ

Alphanumeric, 10 positions; display-only.

Job name

The name of the ASYNC job.

The ASYNC jobs are:

         BILL_ASYNC = Billing background job

         CNTL_ASYNC = Controlling background job

         EBO_ASYNC = Evaluate backorders background job

         ORDR_ASYNC = Order processing background job

         OTHR_ASYNC = Other background job purchase orders)

Each ASYNC job is discussed separately in this part.

Alphanumeric, 10 positions; optional.

Description

The description of the ASYNC job.

Alphanumeric, 40 positions; display-only

Start

The date and time the ASYNC job was last started and the User ID of the person who started it.

(Date):  Numeric, 6 positions; display-only.

(Time):  Numeric, 6 positions; display-only.

(User ID):  Alphanumeric, 10 positions; display-only.

End

The date and time the ASYNC job was last ended and the User iD of the person who ended  it.

(Date):  Numeric, 6 positions; display-only.

(Time):  Numeric, 6 positions; display-only.

(User ID):  Alphanumeric, 10 positions; display-only.

Controlling job

A flag indicating whether this function controls other ASYNC functions. The controlling ASYNC function starts and ends other ASYNC functions.

Valid values are:

         Selected = This is a controlling ASYNC function.

         Unselected = This is not a controlling ASYNC function.

The CNTL_ASYNC job is the only controlling ASYNC job.

System Option

A flag indicating whether this function is a system function that cannot be deleted by the user.

Valid values are:

         Selected = This function cannot be deleted by the user.

         Unselected = This function can be deleted by the user.

Status

The current status of the function.

Valid status codes are:

          *ACTIVE

         *INACTIVE

         *ENDPEND

         *JOBQ

         *REORG

Display-only.

Starting the Background ASYNC Jobs

Purpose: The CNTL_ASYNC job is used to start and end all of the other background ASYNC jobs.

The following background jobs must be active for the records in the data queues to be processed. If the background ASYNC job is not active, records will be held in the data queue until you start the background 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.

Starting the Background ASYNC jobs

You can start the background ASYNC jobs manually at the Work with Background Jobs Screen, or create a periodic process to schedule the ASYNC jobs to start at a specified time.

When you start the background ASYNC jobs, the system removes any terminator records that may exist in the data queues. The system creates a terminator record in the data queues when you end the background async jobs to determine which records to process before the asyncs are brought down and which records to process when the asyncs are restarted. Multiple terminator records may exist in the data queues if you run the ENDASYN periodic function to end the asyncs when the asyncs are already inactive. Because you are now starting the background async jobs, the system no longer needs the terminator records to determine when to reprocess the records in the data queue and instead will process all records that may exist in the data queues.

Before you start the background ASYNC jobs: To start the background ASYNC jobs, the status of each job must be *INACTIVE and each job must not be running. You can use the Display Active Batch Jobs Screen menu option to verify that the jobs are not running.

To manually start the ASYNC jobs:

1.      At the Work with Background Jobs Screen, review the status of the background jobs. The jobs must be started if the status is *INACTIVE.

2.      Select Start for the CNTL_ASYNC job.

3.      The status of the ASYNC jobs should be *ACTIVE.

Unable to start? The system verifies that the job is not currently in active status and is not actually running on any server. If the job is already in active status, or is actually running on a server, the screen displays an error message.

To resolve issues with the job’s status, use the JOBCLN periodic function.

To schedule the ASYNC jobs to start at a specified time: 

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.

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.

         See Using the JOBCLN Function to Resolve Job Status Across Servers for more information on how to reset the async jobs when they are out of sync.

Ending the Background ASYNC Jobs

Purpose: You can end the background ASYNC jobs manually at the Work with Background Jobs Screen, or create a periodic process to schedule the ASYNC jobs to end at a specified time.

Use the CNTL_ASYNC job to end all of the other background ASYNC jobs. You should bring down the background jobs at the end of your processing day.   

When you bring down the background ASYNC jobs:

         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 queues are reorganized. All completed records are deleted from the data queue tables. Records that have not been fully processed will be reloaded to the data queue when the background ASYNC jobs are restarted.

         An error list prints for each background ASYNC job, listing the records that could not be fully processed and the reason for the error.

When the jobs end: The status of each background job will change from *ACTIVE to *INACTIVE. (You may see *ENDPEND or *REORG before you see *INACTIVE, depending upon how long it takes to end each job.)

Note:             You must end the background ASYNC jobs before the ASYNC subsystem is brought down. If you bring down the ASYNC subsystem while the background ASYNC jobs are running, the jobs will be ended but will remain in an *ACTIVE status. You will then need to run the JOBCLN periodic function to reset the status correctly. See Using the JOBCLN Function to Resolve Job Status Across Servers.

To manually end the ASYNC jobs: 

1.      Select End for the CNTL_ASYNC job at the Work with Background Jobs Screen.

2.      The status of the ASYNC jobs changes to ENDING and then to INACTIVE.

3.      When you end the ASYNC jobs, the Display Active Procedure window displays if there are any active procedures for the Order Entry/Maintenance, Purchase Order Maintenance, Receiving, or Confirmation functions. The system creates these records to prevent possible conflicts when users are engaged in these activities. See Display Active Procedure Window.

Unable to end? The system verifies that the job is not currently in inactive status and is actually running server. If the job is already in inactive status, or is not actually running on a server, the screen displays an error message.

To resolve issues with the job’s status, use the JOBCLN periodic function.

Display Active Procedure Window

This window opens when you end the ASYNC jobs if there are any active procedures for the Order Entry/Maintenance, Purchase Order Maintenance, Receiving, or Confirmation functions. The system creates these records to prevent possible conflicts when users are engaged in these activities.

If a user is active in a function:

         the user can exit the function before the ASYNC jobs end. Depending on the activity, the user might need to exit Order Management System and then reenter, if needed, to clear the active procedure record.

         you can select Delete next to each active procedure record to delete the active procedure, or select Delete all to delete them all. Deleting the active procedure does not force the user out of the activity; there is no signal of the deletion to the user and the user can continue entering updates to the record. However, this allows more than one user to access the same record, such as an order or a customer and possibly overwrite each other’s updates.

If neither of these steps clears the active procedure record, you will need to purge the Active Procedures table. See Purging Active Procedures (MACP).

Field

Description

Job #

The system job number assigned to the active procedure.

Numeric, 6 positions; display-only

Program description

The description of the program associated with the Active Procedures record.

Alphanumeric, 3 positions; display-only.

User

The User ID of the person engaged in the activity that created the Active Procedures record.  

Alphanumeric, 10 positions; display-only.

Workstation

The Workstation ID where the user is working.

Alphanumeric, 10 positions, display-only.

Start date

The date when the Active Procedures record was created.  This is the date the user entered the application.

Numeric, 6 positions; display-only.

Time

The time when the Active Procedure record was created.  This is the time the user entered the application.

Numeric, 6 positions; display-only.

To remove active procedures:

1.      Have each person whose name appears in the window exit the application so that you can end the ASYNC jobs. It may be necessary to exit Order Management System temporarily to delete the active procedure record, or

2.      Select Delete next to each active procedure record to delete the active procedure. Deleting the active procedure does not force the user out of the activity; there is no signal of the deletion to the user and the user can continue entering updates to the record. However, this allows more than one user to access the same record, such as an order or a customer and possibly overwrite each other’s updates.

3.      Use Purging Active Procedures (MACP) to delete any stranded Active Procedure records, if necessary. 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.

4.      Select Refresh to refresh the Active Procedure Window to monitor whether the users have exited.

5.      Select Exit to exit the window and return to the Work with Background Jobs Screen.

Deleting active procedure records: You can delete the Active Procedure records at this window by selecting Delete for each record in the window. Deleting the active procedure does not force the user out of the activity, such as order entry; there is no signal of the deletion to the user and the user can continue entering updates to the record. However, it is not recommended to delete Active Procedure records in this way, because it removes the safeguard against two users potentially accessing the same record, such as an order or customer, at the same time.

To schedule the ASYNC jobs to end at a specified time:

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.

Note:             When you end the ASYNC jobs using the job scheduler, the system does not look for active procedures, and instead, ends the asyncs immediately.

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.

Reorganizing the ASYNC Job Data Queues

Purpose: The data queues associated with the ASYNC jobs are reorganized when the ASYNC jobs are ended. Use the Reorganize queue option as a recovery tool only when the ASYNC jobs end abnormally before the data queues have been reorganized. This option allows you to reorganize the data queues before the next ASYNC job end is processed.

To determine if the data queues were reorganized: Display the data queue for an ASYNC job. If the entry date for a record is earlier than the date you last ended the ASYNC jobs, or if records are in a *BLANK status, the data queues were not reorganized. If you do not use the Reorganize queue option, the data queues will be reorganized the next time you end the ASYNC jobs.

When you use the Reorganize queue option, the system deletes completed records from the data queue tables associated with the ASYNC jobs. Records that have not been fully processed will be reloaded to the data queues when the background ASYNC jobs are restarted.

The Reorganize queue option is available only with the CNTL_ASYNC job. All of the ASYNC jobs must be in a *INACTIVE status, and there can be no Active Procedures records for Order Entry, Order Maintenance, Purchase Order Maintenance, Receiving, Confirmation, and PC Manifest functions.

Before you reorganize the data queues: Before you attempt to reorganize the data queues, you should make sure that the status of each ASYNC job is *INACTIVE.

How to reorganize the data queues: Select Reorganize queue for the CNTL_ASYNC job at the Work with Background Jobs Screen.

Active procedures window: A pop-up window opens if there are any users in the Order Entry/Maintenance, Purchase Order Maintenance, Receiving, Confirmation, or PC Manifesting functions. The data queues cannot be reorganized if there are any users in these functions. See Ending the Background ASYNC Jobs.

For more information: See Troubleshooting the Async Jobs for more information on the steps you should take if you suspect the async jobs are not running correctly.

Troubleshooting the Async Jobs

Use the following steps if you suspect that the async jobs are not running correctly.

         Determining the Status of the Async Jobs

         Verifying the Status of the Async Jobs

         Running the JOBCLN Periodic Function to Correct the Async Jobs

         Reviewing the Async Job Log

Determining the Status of the Async Jobs

Use the Display Active Batch Jobs Screen to determine if the async jobs are running across all Order Management System application servers.

         If the async job is listed on the Display Active Batch Jobs Screen, the job is running. Review the My Jobs field for the async job to determine if the status of the async job on the Job Management Screen is accurate. See Verifying the Status of the Async Jobs.

         If the async job is not listed on the Display Active Batch Jobs screen, the job is not running, regardless of the status of the job on the Job Management Screen or the status of each async job on the Work with Background Jobs Screen. See Running the JOBCLN Periodic Function to Correct the Async Jobs for background on resetting the asyncs. Once the JOBCLN completes, you can restart the background async jobs; see Starting the Background ASYNC Jobs.

Verifying the Status of the Async Jobs

The batch jobs displayed on the Display Active Batch Jobs Screen are the jobs that are currently running across all Order Management System application servers. The My Jobs field on this screen indicates if the status of the batch job on the Job Management Screen is accurate. The table below indicates the action to take, based on the status of the async job on the Display Active Batch Jobs screen.

Async Status in My Jobs Field:

Indicates:

Action to Take:

RUN

The async job is running and the status of the job on the Job Management Screen is accurate.

Verify that the status of each of the async jobs that is running displays as *ACTIVE on the Work with Background Jobs Screen.

What if the async job is active but no records are being processed? If this situation occurs, it is possible that the controlling async data queue table has been cleared. To correct, use the JOBCLN periodic function.

MSG

The async job is running, but the status on the Job Management Screen is not accurate.

When the Async jobs in the Background Job Control (MBJC) menu option are active, the system checks the status of each async job on the Job Management screen. 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.

1. If an async job is listed on the Display Active Batch Jobs Screen and its My Jobs status is not RUN, wait a few minutes to see if the system will automatically update the status to RUN.

2. Once the status updates to RUN, verify that the status of the async jobs displays as *ACTIVE on the Work with Background Jobs Screen.

If the async job does not auto-update to a RUN status, you will need to determine if an error occurred. See Reviewing the Async Job Log.

Use the JOBCLN periodic function to correct the async jobs. See Running the JOBCLN Periodic Function to Correct the Async Jobs for more information.

Note:  Never try to end an actively running async job by manually ending it on the Job Management Screen. This does not actually end the async job.

ERR

The async job is running, but a user has manually ended the job on the Job Management Screen while its status was MSG.

END

The async job is running, but a user has manually ended the job on the Job Management Screen.

*RMV*

The async job is running, but a user has removed the job from the Job Management Screen.

End the CNTL_ASYNC that submitted the job. See Ending the Background ASYNC Jobs for instructions.

Once you end the CNTL_ASYNC, the system ends the async job and removes the async job from the Display Active Batch Jobs Screen since it is no longer running. You will need to restart the CNTL_ASYNC in order to resubmit the job and run it again.

Note:  Never remove an actively running async job from the Job Management Screen. If you do this, the system removes all traces of the job from the system, even though the job is still actively running.

Running the JOBCLN Periodic Function to Correct the Async Jobs

The JOBCLN periodic function corrects the status of ASYNC jobs across all servers as follows.

Correcting the status of the BILL_ASYNC, EBO_ASYNC, OTHR_ASYNC, and ORDR_ASYNC:

         Currently running? If one of these ASYNC jobs is currently running, the JOBCLN function does the following:

         If the status is INACTIVE, change the status to ACTIVE; otherwise, do not change the status. Also, for the BILL_ASYNC job, make sure that there is an active procedure if the job is running.

         If there are multiple Ending records for an async job, delete all but one.

         If the job is in END, FIN, or MSG at Job Management (My Jobs) screen, change the status to RUN and update Job History (Display Job History (DJHY)).

         Not currently running? Otherwise, if the ASYNC job is not currently running, the JOBCLN function does the following:

         If the status is ACTIVE, change it to INACTIVE.

         If there is an active procedure for the BILL_ASYNC job, delete it.

         If the job is in RUN or MSG status, or any status except END at the Job Management screen, change the status to END and update Job History.

Correcting the status of the CNTL_ASYNC job:

         Currently running? If the job is running, the JOBCLN periodic function does the following:

         If the status is INACTIVE, update it to ACTIVE; otherwise, do not change status.

         If the status is not in ENDING or REORG status, delete any Ending records for each of the ASYNC jobs.

         If the status is END, FIN, or MSG at the Job Management screen, update the status to RUN and update Job History.

         If the EBO_ASYNC or ORDR_ASYNC jobs are INACTIVE, start them.

         If the BILL_ASYNC or OTHR_ASYNC are INACTIVE, do not change the status because each will start up automatically when data arrives in its queue.

         Not currently running? If the CNTL_ASYNC is not currently running, the JOBCLN periodic function does the following:

         If any other ASYNC job is ACTIVE, create an Ending record if one does not exist.

         If any of the other ASYNC jobs are INACTIVE, delete any Ending records for those jobs.

         If the CNTL_ASYNC status is ACTIVE or ENDING or JOBQ, change to INACTIVE.

         If the status is REORG and the REORG Job is not currently running, change the status to INACTIVE.

         If the status is RUN, FIN, MSG, or any other status at the Job Management screen, update the status to END and update Job History.

Reviewing the Async Job Log

If the async job remains in a MSG status without being auto-corrected by the system, you can also review the async job log to determine if an error occurred.

Async Job Log

To review the async job log: Click the logFile link for the async job on the Job Management Screen to advance to the Log file screen. Note: If the logFile is not a link, the async job was submitted from a different application server; you must log on to the other application server to review the async job log.

If an error occurred during async processing, the system writes an entry similar to the following in the async job log:

2009-04-18 22:09:10,161 ERROR [ JENASYS] execute(): status change to [MSG]:334547java.lang.RuntimeException: java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The result set has no current row. (JenasysJob.java:297)

2009-04-18 22:09:10,177 ERROR [ JENASYS] run(): Job status change to [MSG]. In 'invokeHandler' EXCEPTION occured while calling processServiceRequest. java.lang.RuntimeException: com.microsoft.sqlserver.jdbc.SQLServerException: The result set has no current row. (JenasysJob.java:701)

If an error exists in the async job log, copy the error and the log so that the problem can be researched if needed.

If an error occurred for one async job: Use the JOBCLN periodic function. See Using the JOBCLN Function to Resolve Job Status Across Servers for more information.

 

________________________________