The !FINDPROG() subroutine searches the catalogue for a named program, returning information about it.
CALL !FINDPROG(result, name)
The !FINDPROG() subroutine examines the three catalogue areas in the same order as used when searching for a program within an application (local, private, global). For each instance of the program that is found, information about that program is returned in dynamic array result. This dynamic array has five multivalued fields with a value for each program found:
Applications using this subroutine should allow for further fields to be added to the returned data in future releases.
If the program is not found, result will be returned as a null string.
CALL !FINDPROG(RESULT, 'INVOICE')
NUM.INSTANCES = DCOUNT(RESULT<1>, @VM)
FOR I = 1 TO NUM.INSTANCES
DISPLAY RESULT<1,I> : ' ' : RESULT<2,I>