Introduction to an Escalation Program
Escalation programs will only run on the host system, if a user requires a program to run on a remote system, then the called program option should be used which uses a different approach plus a different skeleton program.
The advantage of an escalation program is that it only runs on a single system, so there is no need to distribute the program to all configured remotes. The disadvantage of an escalation program is that it will automatically turn a message into an inquiry message, so you must remember to add a step at the end of the program to issue the MMSNDRPY command.
The advantage of a called program is that it runs locally on the system that generated the message. The disadvantage of a called program is that it needs to be distributed to all remote systems. (Tip: Create called programs in the MMUSR library, and then use the MMSNDUSR command to automatically distribute the program to all configured remote systems.)
In summary, you have to make the decision of where the program is going to be run. Once that decision is made, you can then use either an escalation program or a called program, as required.
Creating an Escalation Procedure Program
Running a program when a message is generated can be done using a special type of escalation procedure. To create this type of escalation procedure, follow the procedure detailed below:
Start at the QMessage Monitor main menu (GO QMM).
Select option 13, Escalation Procedures, which brings you to the Escalation Menu.
Now, select option 1, Maintain: Escalation Procedures.

In the Escalation Procedure Maintenance screen, press the F6 key to add a procedure. You should see the following screen:

In the Procedure Code field, enter a name for you procedure.
Enter a description in the Description field.
In the Type of escalation field, enter a “P” for program.
Leave the Maximum instances parameter with the default value. This field is used to limit the number of times this escalation procedure can be running at the same time, to stop the system from choking when an escalation procedure is repeatedly triggered, possibly submitting thousands of jobs for escalation.
For the purpose of this document, the Security List field will be ignored because product security is covered in a separate Support topic.
Press Enter.
A new parameter, called Program and a new function key, F9, appear on the screen. There are two fields that need to be filled in for Program.
The first is the name of the program (it does not need to exist).
The second is the name of the library where the program will reside. The library needs to have a CL source file in it.
After you have filled in the program and library press the F9 key to edit the source.

The Edit Source screen appears along with the error message “program not found” in the lower left hand corner.
All the fields are populated automatically.
Clear the error message and then press the F6 key to create the program.

The next screen shows the CL program shell. The required program parameters you need are already be there.

Now, add your own code from statement 24.00.

When you have finished, press F3 to exit to the save parameters.

When you press Enter, you're prompted to submit the job that creates the program. Amend the parameters as required.

When you press Enter, you return to the Escalation Procedure screen.
Press F3 to exit. Check your spool files for the job that created the program to confirm that the program has been created to your satisfaction.
Finally, attach the escalation procedure to an Auto Reply record and test your handiwork.