Problem solve Get help with specific problems with your technologies, process and projects.

Executing a CL command on AS/400

ISeries backup and recovery expert Ken Graap explains how to use FTP, the QUOTE command and the RCMD command to execute a CL command on AS/400.

Is there a way to run a command from Windows that will start a session and execute a CL command on AS/400? We basically need to stop a subsystem before we back it up.
Yes there is, using FTP, the QUOTE command and the RCMD command.

For example, to end subsystem XYZ on System S02, you would take the following steps:

  1. Start an FTP session to your iSeries. The FTP server on iSeries will need to be running.
  2. Sign on with a user profile that has at least *JOBCTL.
  3. From your PC, open a CMD window, then issue the following commands:
C:>ftp s02
Connected to s02.xxx.com.
220-QTCP at s02.xxx.com.
220 Connection will close if idle more than 5 minutes.
User (s02.xxx.com:(none)): keg
331 Enter password.
230 KEG logged on.
ftp> quote rcmd endsbs xyz *immed
250 Command endsbs xyz *immed successful.

Dig Deeper on iSeries CL programming