Modifying the JCL to specify the KEYLIST, KEYRANGE and MAXROOTS parameters

Generating a batch job that performs a print describes how you can use the Print dialog to generate the JCL for a job that prints data from an IMS database.

There are, however, three parameters you can use that the Print dialog does not generate. These are the KEYLIST, KEYRANGE and MAXROOTS parameters.

The KEYLIST parameter allows you to specify a list of the root segment key values of the database records that you want printed. You can, of course, specify this list in a keys file, but this parameter provides you with an alternative way of specifying the key list. Unlike the keys file, however, the KEYLIST parameter also allows you to specify partial keys - if the length of a specified root key value is less than the key length of the root segment, the function considers it to be the first part of the key and prints all those database records with root key values that match the partial key value.

The KEYRANGE parameter allows you to specify the start and end of a range of root key values. The function prints those database records that have a root key value in the specified range.

The MAXROOTS parameter allows you to limit the number of database records that the function prints. When this parameter is specified, the function counts the number of database records that it has printed and terminates when it reaches the specified limit.

For information on how you code these parameters, see Print (IPR).