What is EQQRETWM and how can it help me manage my batch?
EQQRETWM is a program that has been provided with TWSz for many years. It resides in your SEQQLMD0 load module library. This program can do one and/or two of the following:
1. Optionally wait a specified amount of time
2. Optionally abend the job with any abend code, return code, etc.
You can see how to use it by looking in your SEQQSAMP sample library, under the member EQQRETWT. Here's a few examples on how to use it:
Wait for 300 seconds, and then end normally (ie. RC=0)
//STEP010 EXEC PGM=EQQRETWM,PARM=WT300
Wait for 10 seconds, then abend with a S0C4 abend:
//STEP010 EXEC PGM=EQQRETWM,PARM='WT10,SA0C4'
Do not wait, give a return code 16:
//STEP010 EXEC PGM=EQQRETWM,PARM='RC0016'
You can also 'embed' the program EQQRETWM inside other jobs, to abend something:
For instance, say you have a job that normally runs and gives a return code 0. If the job returns a step code 2, we can abend the job with a user abend code 222:
//MYJOB JOB MSGCLASS=X,MSGLEVEL=(1,1),TIME=(1440),REGION=0M
//STEP001 EXEC PGM=mypgm
//CHEK001 IF STEP001.RC = 2 then
//KABOOM EXEC PGM=EQQRETWM,PARM='UA222'
Of course, you can set up the acceptable return codes in TWSz itself, but EQQRETWM allows you multiple return code processing, so it can make your batch a lot more automatic and powerful.