You are on page 1of 8

My Job Tool For AS/400

By
Atom Kumar Padhy
Table of Contents

1. Introduction..................................................................................................................... 3
2. Program High Level Logic ............................................................................................. 4
3. Command Interface and Input Parameters...................................................................... 5
4. Program main Screen Interface....................................................................................... 7

2
1. Introduction

The Job Tool is a SQLRPGLE program which uses the i-Series native APIs QUSLJOB,
QUSRJOBI, QUSLSPL, QUSRSPLA etc to scan thru the jobs on the system to come up
with the list of jobs fulfilling the user search criteria. Using the tool, you can search for
jobs with one or more of the selection criteria given below:
 Search Jobs with Wild Characters in Job Name search field. (Helpful in searching
jobs triggered with dynamic job names or the jobs whose names follow a pattern).
 Search Jobs with Wild Characters in User Name search field.
 Search Jobs in a particular Status. (Helpful to Search jobs that are currently
ACTIVE or in JOBQ or in MSGW or in LCKW or DSC etc status).
 Search jobs in a particular subsystem.
 Search jobs of particular type. (Batch or Interactive or Subsystem or Subsystem
Monitor etc).
 Search Jobs that were active in a given time range.
 The tool also allows doing all the functions on the jobs that you can do from
native WRKUSRJOB, WRKJOB, WRKSBMJOB, WRKACTJOB commands.
Along with this, you can also download any spooled file from the job to your IFS
folder.

3
2. Program High Level Logic
1. The program first creates the list of all active jobs using the API QUSLJOB based
on the parameters – JOB NAME, USER NAME, JOB STATUS(*ACTIVE,
*JOBQ, *OUTQ) and JOB TYPE.. So if these parameters are specified without
any wild characters then the results come up lightning fast. Even if you don’t use
them, no problem. After all the tool is designed to be used specifically if you
don’t have these parameters.
2. After getting the list of jobs on the system based on the input parameters from
Step 1, the program scans thru these jobs and puts them into a file JOBTAB in
QTEMP. From there the scanning process starts based on other input parameters
and displayed on the Screen.
3. Depending on various action codes on the displayed jobs, various commands are
issued so as to get the users request done for him.
4. For downloading spooled files for any job, the program uses QUSLSPL and
QUSRSPLA APIs to get spooled files details, then writes the spooled file to a PF
in QTEMP and then copies it to a Stream File in IFS.

4
3. Command Interface and Input Parameters

The Command for running this program is JOBTOOL. The various kind of Job inquiries
that you can do using this command are:

Search jobs with names like PYW*04:

Search all jobs from user ID like ATOM* :

Search all jobs in MSGW status:

5
Search all jobs that were active during the time frame (10/10/24 9.00 am and 10/10/24
10.00 am):

Search all Subsystem Monitor jobs:

6
4. Program main Screen Interface
Shown below is the main screen of the program listing the jobs that qualified your search
criteria.

The various action codes available on these jobs are shown below:

7
Option 1 allows us to view and download the spooled files for the job to your IFSSHR
folder. The path \\IFSSHR\YourUserID should exist in the IFS root directory.

Other action codes cover all the work that can be done on the job using the native
WRKJOB, WRKUSRJOB, WRKSBMJOB etc commands.

You might also like