0

I am just writing an Interface between a java application and an AS400. For this purpose I use jt400. I managed to get information about the systemstatus like CPU usage, as well I managed to receive the current status about subsystems and jobs.

Now I am searching for an option to have a look at the different job queues inside the AS400.

For example: I would like to know, how many jobs are in which queue.

Is there a solution via jt400 or a different approach to access those information via java?

The corresponding command inside AS400 is WRKJOBQ

Best LStrike

[Edit]

The following code is my filter for JobList. But how do I configure QSYSObjectPathName that it is matching WRKJOBQ?

QSYSObjectPathName path = new QSYSObjectPathName(.....);

JobList jList = new JobList(as400);
jList.addJobSelectionCriteria(JobList.SELECTION_PRIMARY_JOB_STATUS_JOBQ, true); 
jList.addJobSelectionCriteria(JobList.SELECTION_JOB_QUEUE, path.getPath());
Job[] jobs = jList.getJobs(-1, 1);
System.out.println("Jobs Size: " + jobs.length);
LStrike
  • 1,598
  • 4
  • 26
  • 58

1 Answers1

3

You can use a JobList object for that, using SELECTION_JOB_QUEUE to filter jobs.

Once your selection suits your need, JobList#getLength() will give you the number of jobs.

See also this question

Community
  • 1
  • 1
  • Thanks for your hint, but how do I configure QSYSObjectPathName that it is matching WRKJOBQ? – LStrike Apr 12 '16 at 12:25
  • If you are talking about WRKJOBQ without any argument, you need to use your user profile *JOBQ (if I remember well WRKUSRPRF should display its name or maybe it's somewhere on the WRKJOBQ screen). –  Apr 12 '16 at 12:48
  • Or are you asking how to enumerate *JOBQ? –  Apr 12 '16 at 12:50
  • I know how to enumerate the result. I used JobList already to receive information about all BATCH JOBS in the System. Now I try to receive information about the different JOBQs which could be displayed with the command WRKJOBQ. – LStrike Apr 12 '16 at 12:56
  • 1
    I'm afraid it's in the [todo list](http://jt400.sourceforge.net/todo.html): "Job queues - Implement a JobQueue class so that the queue can be checked for inconsistencies, abnormalities or errors. (i.e. overflow, operational issue, etc.)". You could probably wrkjobq in a file then read the file and use jobList on each jobq –  Apr 12 '16 at 13:02
  • damn ;-( OK good to know. Thanks a lot for your help. I will talk to my colleague if we can implement a custom feature like you suggested. – LStrike Apr 12 '16 at 13:07