Chapter 1 - The JOBWATCHCF Command

The JOBWATCH command consists of the following options:

  8/25/04                     Job Watch (JOBWATCH)                    TS400

 08:45:56                    Job Status Maintenance                     BVSTONE

 Type options, press Enter.

  1=Add   2=Work with Command   3=Copy   4=Delete   5=Activate/Deactivate

 Opt Status Command

  _  ____   ________________________________________________________________

  _  *C50   SNDMSG MSG('Job &J User &U Job Number &N has a CPU% of over 5...

  _  MSGW   MAILTOOL TOADDR(address@domain.com) FROMADDR(sysop@domain.com...

  _  MSGW   SNDDST TYPE(*LMSG) TOINTNET((address@domain.com)) DSTD('Job &...

                                                                        Bottom

 F3=Exit   F4=Prompt   F5=Refresh   F6=Job Maintenance   F7=MSGQ Maint

The JOBWATCHCF command allows you to view and work with commands that are set up on your system. Active commands are shown in yellow, and inactive commands are shown in green.

Job Maintenance

Pressing F6 from this screen will bring you to the Job Watch Job Maintenance Screen.

 10/21/08                     Job Watch (JOBWATCH)                    S1012CBA 

 14:20:06                       Job Maintenance                       BVSTONE   

 

 Type options, press Enter. 

  1=Add   2=Work with Command   3=Copy   4=Delete   5=Activate/Deactivate 

                                                                                

 Opt Status  Job Name     Min Command                                           

  _  _______ __________ _____ _________________________________________________

  _  *ACTIVE TESTING       10 MAILTOOL TOADDR(bvstone@bvstools.com) FROMADDR...

 

                                                                         Bottom 

 F3=Exit   F4=Prompt   F5=Refresh 

Enter a status, job name, and the minimum number of jobs you want to check that are active. The command entered for this entry will be run only if the total number of jobs that match the status is less than the minimum number of jobs specified on this entry.

 

With v3.01 SP111006 and up you have the ability to use wildcards for the job name.  In this case, the minimum jobs will be counted against the total jobs found that match the wildcard.

With v3.10 and up, when the status is *MINACT you are telling the system to check the total minutes the job has been active against the value in the MIN column (which would be the maximum minutes before the command associated is run).  If the job has been running longer than the specified time the command will be run.

MSGQ Maintenance

Pressing F7 from this screen will bring you to the Job Watch MSGQ Maintenance Screen.

 9/10/19                     Job Watch (JOBWATCH)                    S216709W  

09:16:15                       MSGQ Maintenance                      BVSTONE   

                                                                               

Type options, press Enter.                                                     

 1=Add   2=Work with Details   3=Copy   4=Delete   5=Activate/Deactivate       

                                                                               

Opt MsgQ Name  Msg Type   Mn Sev Command                                       

 _  __________ *ALL            0 ____________________________________________________________________                                              

 _  QSYSOPR    *ALL           50 MAILTOOL TOADDR(bvstone@bvstools.com) SUBJ...  

Enter a status, job name, and the minimum number of jobs you want to check that are active. The command entered for this entry will be run only if the total number of jobs that match the status is less than the minimum number of jobs specified on this entry.

 

With v3.01 SP111006 and up you have the ability to use wildcards for the job name.  In this case, the minimum jobs will be counted against the total jobs found that match the wildcard.

With v3.10 and up, when the status is *MINACT you are telling the system to check the total minutes the job has been active against the value in the MIN column (which would be the maximum minutes before the command associated is run).

The following options are availble for both screens:

Working With Commands

                               Enter Extended Command

 Status  . . . MSGW

 Enter extended Command:

 MAILTOOL TOADDR(address@domain.com) FROMADDR(sysop@domain.com) SUBJECT('Job &J

in &S Status at &M') MESSAGE('The following job in is &S status:\n\nNSystem: &M\

nJob: &J\nUser: &U\nJob Number: &N\nSubsystem: &L/&Y\nFunction: &F\nJob Type: &T

\nJob Subtype: &B') SENDWITH(*MAILTOOL)_________________________________________

____________________________________________________...

Trim: *YES

 F4=Prompt   F12=Cancel

Option 2 allows you to work with a current command for an entry. On this screen you can enter and edit commands. F4 will allow you to prompt on the command.

All command options now have a TRIM option that will tell the JOBWATCH program to either TRIM the replacement variable data or not.  Specify *YES when using a command or *NO when calling a program and the replacement variables are used as parameters.

On the MSGQ Maintenance screen there is also a timestamp field that should be initially set to know what date/time to start looking for messages.  Any time a match is found for a MSGQ entry the timestamp will be automatically updated to the latest message timestamp so messages will not be repeated.

Available Status Codes

When setting up a new entry in the Job Status Maintenance Screen, the following status codes are availble for use:

BSCA Waiting in a pool activity level for the completion of an I/O operation to a binary synchronous device.

BSCW Waiting for the completion of an I/O operation to a binary synchronous device.

CMNA Waiting in a pool activity level for the completion of an I/O operation to a communications device.

CMNW Waiting for the completion of an I/O operation to a communications device.

CMTW Waiting for the completion of save-while-active checkpoint processing in another job.

CNDW Waiting on handle-based condition.

CPCW Jobs waiting for the completion of a CPI Communications call.

DEQA Waiting in the pool activity level for completion of a dequeue operation.

DEQW Waiting for completion of a dequeue operation. For example, QSYSARB and subsystem monitors generally wait for work by waiting for a dequeue operation.

DKTA Waiting in a pool activity level for the completion of an I/O operation to a diskette unit.

DKTW Waiting for the completion of an I/O operation to a diskette unit.

DLYW The Delay Job (DLYJOB) command delays the job for a time interval to end, or for a specific delay end time. The function field shows either the number of seconds the job is to delay (999999), or the specific time when the job is to resume running.

DSC Disconnected from a work station display.

DSPA Waiting in a pool activity level for input from a work station display.

DSPW Waiting for input from a work station display.

END The job has been ended with the *IMMED option, or its delay time has ended with the *CNTRLD option.

EOFA Waiting in the activity level to try a read operation again on a database file after the end-of-file has been reached.

EOFW Waiting to try a read operation again on a database file after the end-of-file has been reached.

EOJ Ending for a reason other than running the End Job (ENDJOB) or End Subsystem (ENDSBS) command, such as SIGNOFF, End Group Job (ENDGRPJOB), or an exception that is not handled.

EVTW Waiting for an event. For example, QLUS and SCPF generally wait for work by waiting for an event.

GRP Suspended by a Transfer Group Job (TFRGRPJOB) command.

HLD Held.

HLDT Held due to suspended thread.

ICFA Waiting in a pool activity level for the completion of an I/O operation to an intersystem communications function file.

ICFW Waiting for the completion of an I/O operation to an intersystem communications function file.

INEL Ineligible and not currently in the pool activity level.

JVAA Waiting in a pool activity level for a Java program operation to complete.

JVAW Waiting for a Java program operation to complete.

LCKW Waiting for a lock.

LSPA Waiting in a pool activity level for a lock space to be attached.

LSPW Waiting for a lock space to be attached.

MLTA Waiting in a pool activity level for the completion of an I/O operation to multiple files.

MLTW Waiting for the completion of an I/O operation to multiple files.

MSGW Waiting for a message from a message queue.

MTXW Waiting for a mutex. A mutex is a synchronization function that is used to allow multiple jobs or threads to serialize their access to shared data.

MXDW Waiting for the completion of an I/O operation to a mixed device file.

OPTA Waiting in a pool activity level for the completion of an I/O operation to an optical device.

OPTW Waiting for the completion of an I/O operation to an optical device.

OSIW Jobs waiting for the completion of an OSI Communications Subsystem for OS/400 operation.

PRTA Waiting in a pool activity level for output to a printer to complete.

PRTW Waiting for output to a printer to be completed.

PSRW A prestart job waiting for a program start request.

RUN Currently running in the pool activity level.

SELW Waiting for a selection to complete.

SEMW Waiting for a semaphore. A semaphore is a synchronization function that is used to allow multiple jobs or threads to serialize their access to shared data.

SIGS Stopped as the result of a signal

SIGW Waiting for a signal

SRQ The suspended half of a system request job pair.

SVFA Waiting in a pool activity level for completion of a save file operation.

SVFW Waiting for completion of a save file operation.

TAPA The job is waiting in a pool activity level for completion of an I/O operation to a tape device.

TAPW Waiting for completion of an I/O operation to a tape device.

THDW Waiting for another thread to complete an operation.

TIMA Waiting in a pool activity level for a time interval to end.

TIMW Waiting for a time interval to end.

You also have the option of monitoring jobs for CPU percentage.  This is done using *CXX where XX is the percentage you want to monitor for.  If a job is found to have equal or higher CPU percentage than XX the command will be run.  For example, *C50 will monitor for jobs with a CPU percentage of 50% and up.

When setting up a new entry in the Job Maintenance Screen the following status codes are available.

*ACTIVE -Only active jobs are counted towards the minimum jobs.

*JOBQ - Only jobs on a job queue are counted towards the minimum jobs.

*OUTQ - Only jobs on an output queue are counted towards the minimum jobs.

*ANY -Any jobs status is counted towards the minimum jobs.

*MINACT - Will check active jobs for the total minutes active against the value listed in MIN (which in this case will be the maximum number of minutes active before the command will be run).

Available Substitution Variables

When working with commands with the JOBWATCH Job Status Maintenance the following substitution variables are available:

The following additional replacement variables are available when using *MINACT from the Job Maintenance Commands:

When working with commands with the JOBWATCH Job Maintenance the following substitution variables are available:

When working with commands with the MSGQ Maintenance the following substitution variables are available: