I am running a CL program that calls a QSHELL command from batch. I am getting the following:
QSH0002 error code 3489 reason code 4.
QSHELL message 3489 is ENOSYSRSC. Most of the time this message is caused by trying to run QSH from a subsystem where the subsystem has a only a maximum active job of one. If you can run the command interactively but not from your CL batch program, it is likely that it is due to the maximum active jobs of the subsystem.
To see the maximum active jobs for a subsystem:
- On the OS/400 command line type the following (for example, for QBATCH):
- Press Enter.
- Select Option 1, Operational attributes.
- Review and increase the maximum number of active jobs parm if needed.
Also, although spawn() (and, therefore, QSHELL) bypass the job queue, if the maximum jobs are changed, typically the maximum active jobs for a job queue also must be changed. This is displayed under --> 6. Job queue entries.
Since this error message is a result of running out of available jobs, put this job in its own subsystem or increase the number of jobs allowed to be running in the subsystem.