There is another way as well to locate a job which would not involve searching through the work control block tables.

It's outlined in Chapter Nine of Leif's E-Book, "The Work Control Block Table". The second half of the chapter tells how to use the Job Machine Index, a system pointer to which is located in the Master Work Control Block. If the index search operation succeeds, you can get a space pointer to the entry in the WCB Table describing the job; and from there, your program would be the same. Of course, access to the Job Machine Index is limited, I believe, to system state programs.

Of course, using the Job Index to find your job would involve quite a few changes to your program!

From: "Robert Houts" <rshouts@xxxxxxxxx>
To: "'MI Programming on the AS400 / iSeries'" <mi400@xxxxxxxxxxxx>
Sent: Tuesday, May 13, 2008 7:39 PM
Subject: Re: [MI400] MI program unable to locate job - need assistance

I'm not sure about V6R1 (or 6.1.0 as IBM now calls it), but up to V5R4 there
is still a maximum of 30 tables. Each table can have a maximum of 16,352
jobs and the QMAXJOBS system value is limited to 485,000. Thirty tables can
hold up to 490,560 jobs. In the job table header object (QWCBT00) there is
a 2-byte binary field at offset 1CB (decimal offset 459) that contains the
count of tables. On a system with 13 tables:

Display Job Tables
Permanent job structures: Temporary job structures:

Initial . . . . : 32767 Initial . . . . : 16384

Additional . . . : 500 Additional . . . : 500

Available . . . : 57008 Available . . . : 12999

Total . . . . . : 207557

Maximum . . . . : 391670


Table Size Total Available In-use Other

8 16752384 16352 0 16352 0

9 16752384 16352 3454 12898 0

10 16752384 16352 10332 6020 0

11 16752384 16352 15539 813 0

12 16752384 16352 16348 4 0

13 11640576 11334 11334 0 0


Dumping QWCBT00 reveals the following:

0001A0 00000000 00000000 00000000 00000000
0001C0 003C0000 0007F600 00000000 0D000000
0001E0 00008000 00000000 234BC6A4 A3000E38

The second line above shows x'000D' at offset 0001CB. This is decimal
offset 459, or decimal position number 460 (hex position number 1CC).

I've checked this on at least 10 different systems (V5R2, V5R3, and V5R4)
with differing numbers of job tables and this field is definitely the count
of tables.

Using this field is the easiest way of ensuring that you will process all
tables. To future-proof your code, make the array larger and use the table
count for your limit.

This is the MI Programming on the AS400 / iSeries (MI400) mailing list
To post a message email: MI400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: MI400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.