On the iSeries (AS/400), RPG programs may not be loaded more than one time in a job invocation stack, ie they may not be called recursively. ActionWare provides standard program that can be called to determine if a specified program is already in existence in the job invocation stack.
The program is AMCHKA with two parameters: program name (character 10) and a return code=Y/N (character 1).
To determine if ActionWare is already loaded in the user's current job, use the following check:
CALL AW4/AMCHKA ('AM015' &YESNO)
The program will return a 'Y' if the ActionWare main program (AM015) is already loaded.
The AMCHKA program exists in all ActionWare libraries and is available for use by user application programs. Users may copy it to their own library or use it from any of the ActionWare libraries (typically AW4 or AW4L). It may be called from CL or RPG or from any other iSeries (AS/400) language that can call an RPG program. The program being tested for does not have to identified by its library location, just the program name is needed.
Last Updated: May, 2005