MAC-PAC Homecontact ussupport login 
Documentation > MAC-PAC Reference and Help > Technical Support > Key Concepts and Procedures > Control Language > Asynchronous Program Callers

Asynchronous Program Callers

 

 

Characteristics

Asynchronous program callers have the following characteristics:

·     They are used to call RPG programs for posting transactions that require extensive I/O operations.

·     They are triggered by a program, such as the MAC-PAC Monitor (MPASYNCMON) Control Language Program, after it reads a message (transaction) from the message queue MPASYNMSGQ. 

-    The asynchronous monitors can be set up as an autostart job in subsystem QINTER with a job description and job name.  In this case, if no messages are waiting in the message queue, the monitor waits until a message arrives.  If it receives the message SHUTDOWN from the Control Language Program SHUTDOWN, the message monitor program ends.  If the asynchronous monitor is ever terminated abnormally, it must be restarted with a SBMJOB command to job queue QINTER.  Otherwise, subsystem QINTER must be brought down and brought back up to restart the job. 

-    The monitor can also be initiated/canceled from the Initiate/Cancel Monitors Menu as required.  Again, the monitor waits until a message arrives or until a request to cancel the monitor is received.

-    Refer to the Technical Support Manual, Operating Procedures section, for additional information.

-    They are triggered by one of the monitor control language programs after a message is read from the corresponding message queue.  These monitors are only present if Order Processing is installed.

-    These monitors can be set up as autostart jobs if new job descriptions are created or if the job description MPASYNCJOB is modified before compiling.  In this case, a monitor will wait for messages until a message is received.  The monitor programs continue until an end-of-file message is received.

-    These monitors can also be initiated/canceled from the Initiate/Cancel Monitors Menu as required.  Again, the monitor waits until a message arrives, or until an end-of-file message is received.

-    Refer to the Operating Procedures section of the Technical Support Manual for additional information.

Processing

The following processing takes place for each asynchronous program caller:

·     The user executing the sending program enters a transaction that is to be posted asynchronously.

·     The sending program validates and writes out the transaction or transactions to an asynchronous transaction file.

·     The sending program then sends a message to the asynchronous message queue to notify the message monitor program that there is a transaction or group of transactions waiting to be posted.  The message, which is sent using the DSPLY operation code, contains a transaction identifier and enough data to identify the transaction or group of transactions.

·     The monitor program takes the message off the message queue, reads the transaction identifier and calls the appropriate asynchronous program caller control language program.  The transaction keys are passed as parameters to the asynchronous processing program.

·     The posting program receives the keys as parameters, uses them to retrieve the transactions from the asynchronous transaction file, and posts the transaction to the appropriate master files, writing the audit trail and transaction register records.  The transaction then is deleted from the asynchronous message file; control returns to the message monitor program, which then waits for the next message to arrive.