Previous Topic: Changing List EntriesNext Topic: Combining Lists


Checking or Verifying Lists

It is possible that in the interval between building a Toolkit list from existing objects or members, and actually using the list, the original objects or members might be deleted or moved to another library or file. To check whether the entries in a list are still current, you may use the Toolkit command Check List Entry (YCHKLSTE), which will check each entry in a Toolkit list against a specified library, source file, or both. For instance:

YCHKLSTE LSTTYPE(*OBJ) LST(QGPL/FRED) CHKLIB(QGPL) CHKFILE(QGPL/*QDFTSRC)

The Check List Entry command can be particularly useful for testing whether objects have a corresponding source member or vice versa. It can also be used to compare the contents of two libraries.

Using the UPDLST parameter of the Check List Entry command, you may specify either that the list entries which are found to be in error are to be removed or flagged, or that list entries which are successfully verified are to be removed or flagged. The latter option provides a convenient way of examining a member list to see which source members still need compiling.

For example, the following command would check the entries in member list FRED to ensure that for each member there was a corresponding object in library QGPL. Any entries without objects would be removed:

YCHKLSTE LSTTYPE(*MBR) LST(FRED) CHKLIB(QGPL) UPDLST(*RMVERR)

You can also use the YCHKLSTE command in your own CL programs to test whether a list is empty: an escape message will be sent if no entries can be found. For example:

YCHKLSTE LSTTYPE(*OBJ) LST(FRED)
 MONMSG MSGID(YYY0103) EXEC(RETURN) /* list is empty */