The AS400 Agent can be started and stopped by commands STRUCAGENT or ENDUCAGENT. Documentation to the use of this instruction can be found here.
Actually the
STRUCAGENT is referencing the job description
UC4AGENT which is an object belonging to the agent library.
https://us.v-cdn.net/5019921/uploads/editor/n9/dy2l7aahczf7.png" width="578">
WhenSTRUCAGENT submits the agent program as a job in batch mode withSBMJOB command,SBMJOB will refer to this job description (JOBD object).
SBMJOB
CMD(***) JOB(UC4AGENT) JOBD([Agent LIBRARY]/UC4AGENT)
Per default the Job DescriptionLIBRARY/UC4AGENT points on the QBATCHjob queue from theQBATCH subsystem.
https://us.v-cdn.net/5019921/uploads/editor/5a/xh70ebtnqmjw.png" width="575">
More details about use and syntax ofSBMJOB can be retrievedhere on the IPM portal.
By changing
the following attributes of that Job Description object you can assign a another Job Queue.
Job queue . . . . . . . . . . . ______ Name, *SAME
Library
. . . . . . . . . . . _______ Name,
*LIBL, *CURLIB
Please remember that subsystem (object type SBSD) always belong to a library. For instance,QBATCH subsystem is part of the system libraryQSYS, but the job description belongs toQGPL.
https://us.v-cdn.net/5019921/uploads/editor/qu/9py0mzbf26vw.png" width="571">
As job queues are always assigned to a sub system, the agent
can be started that way in any Subsystem according the system needs.Thus the agent will be controllable, that means startable or stoppable from any particular Subsystem of your choice.