The CATALOGUED() function determines whether a subroutine can be found using the search process described for the CALL statement.
The CATALOGUED() function returns
Where a subroutine name appears in more than one catalogue form, the search order is as in the list above and the value returned reflects the first entry found.
The return value from the CATALOGUED() function can be treated as a Boolean (True/False) value if the application merely wants to determine if a subroutine is catalogued and does not need to know in which format.
IF NOT(CATALOGUED('MYPROG')) THEN DISPLAY 'Not catalogued'
This statement displays a message if MYPROG is not in the system catalogue.