Validate the library

The goal of the function "Validate library" is to return a return code indicating whether the library can be supported by the exit.

The key return codes are:

Library supported by this exit.
Library not supported. Z Data Tools should try other access methods to try to read the data in the library.
Some other error occurred.

The sample COBOL exit validates a PDS by checking to see if it contains a member named $$HFM$$. If $$HFM$$ exists, the exit returns rc=0. If not, it returns rc=120.

There is a performance enhancement included in the sample code: if the library has already been validated, the validation is not repeated. This can only safely be done if the previous return code was 0 or 120. If it was some other value, the validation must be repeated. For example, if the previous validation found that the data set was in use, the validation must be repeated.

To support a customer LMS, you can replace the USER-REPOS-VALIDATE paragraph and leave the remaining code unchanged.