Creating an IBM AS/400 Process Server
This document covers the installation, syntax and operation of the IBM AS/400 connector for Redwood Server. This can be used to manage chains, processes, and file events on AS/400 systems. It does not cover installing Redwood Server to run on an application server on AS/400, that is covered by a separate document.
note
AS400 process servers are only available when your license includes a non-zero value for the key ProcessServerService.AS400.limit. Process servers that include the AS400 job definition type will not be counted towards the ProcessServerService.OS.limit and ProcessServerService.External.limit license keys.
AS/400 process servers require the following key:
- ProcessServerService.AS400.limit - the total number of AS/400 process servers
You set the AS400Server
process server parameter to the default AS/400 system, you can override this on the process definition by specifying a parameter of the same name.
Running Jobs
To run an AS/400 job, Redwood Server makes a connection to the AS/400 using the AS/400 process server parametersAS400Server
and AS400User
(the latter can be overridden by the process definition Run As user ). It then executes the command:
SBMJOB CMD(command) AS400JobAppend
This should produce a CPC1221
message containing the AS/400 job ID. This job ID (and other information) is then written to the Remote attributes of the &Process, and can be seen in the Processes monitor.
The job is then monitored until it reaches any job status in AS400JobTerminalStates, or it reaches the job status *ACTIVE
and any active status in AS400JobFailOnActiveStatus. During this process any messages on the job except those whose codes are listed in AS400JobIgnoredExceptions will cause the process to go into Error
.
If the job reaches a status in AS400JobTerminalStates, then the spool files are retrieved according to the process server and process definition specification. If a job log is found, this log is parsed and the return code fetched. If the return code is not 0
, then the process is put into Error. If no log is found the process is put into Completed.
If it reaches a status in AS400JobFailOnActiveStatus then the process is put into Error.
Prerequisites
Redwood Server
- The license key ProcessServerServiceAS400.limit
AS/400
- OS/400 (aka i5 OS) V5R0 or later
- Older versions are possible (down to V4R3)
- Connectivity from the host on which Redwood Server is installed to the AS/400
- Connectivity from the secure gateway to the AS/400
- Ports
8470
and8476
(9475
and9476
for SSL/TLS) of the AS/400 application server need to be open and accessible.- See JTOpen - Server ports used for more information
No additional software needs to be installed on the AS/400.
Procedure
Creating an AS/400 process server
- Navigate to "Environment > Process Servers".
- Choose New Process Server from the context-menu.
- Select AS/400 (IBM System i) and choose Next.
- Fill in the name.
- On the Queues tab, add a dedicated queue for the AS/400 system, we recommend a dedicated queue for each AS/400 with the same name as the AS/400. Other queues are optional.
- On the Parameters tab, add values for:
- AS400Server - If you don't need file events, and want to put the username/password in the process definition Run As User field.
- AS400Server and AS400User - If you want file events, or don't want to put the username/password in the process definition Run As User field.
See the AS/400 Process Server Parameters for more information on AS/400-related process server parameters.
Check that the process server is running:
- Navigate to "Environment > Process Servers".
- Check the status icon of the process server, a connecting status can indicate a problem if it persists after 1 minute, refresh the view.
- Expand the process server, check the status icon next to the AS400 service.
You can now start the process server. If it won't start, check the operator messages.
- Navigate to "Monitoring > Operator Messages".
- Scroll down to the latest entries.
- Look for the name of the AS/400 process server.
Test the process server by running a process that should complete successfully
- Create a process definition called AS400_DSPJOB containing only the text
DSPJOB
, and submit it to run on the AS/400 system. - The job should run on the AS/400 and the output of the
DSPJOB
command should be visible in the QPDSPJOB.1 file.
Test the process server by running a job that should fail
- Create another process definition called AS400_Always_Fail, with the command text below. This command will fail with an error code.
- Check that the process return code and the return code in the log match up.
- Navigate to "Monitoring > Processes".
- Locate the process that failed, choose it.
- In the lower details pane, expand Files and open
stdout.log
andstderr.log
, make sure the return code in the file matches the return code in the lower detail pane.
Command text for AS400_Always_Fail
DSPJOB JOB(000000/*N/REDWOOD)