Files on AS/400 Raise Events
AS/400 file events are created in the same way as other file events. To check for files that match AS/400 file events, RunMyJobs connects to the AS/400 for each file event using the credential matching the AS/400 Process Server parameters AS400Server
and AS400User
. RunMyJobs then looks for files, according to the directory and pattern specified by the file event. If a file is found, a file event is raised, and the file is optionally moved to a different directory.
Note: AS/400 file events are raised on the remote AS/400 computer, which does not need a Platform Agent present.
Note: No lock checks are performed on files. Use Minimum age and Minimum size to specify when a file should raise the event.
Library File System
The AS/400 file system does not work in the same way that a UNIX or Windows file system does. AS/400 systems have a number of different file systems exposed via the IFS. Files are often located in libraries, and libraries may be located inside of other libraries (either the QSYS
or QGPL
libraries). The library file system provides you with access to database files and all of the other IBM i object types that libraries can contain. To access a file in a library, you must have the full path to the file you are looking for.
Note: For more information about the library file system, see Library file system (QSYS.LIB).
You can browse the file system from within RunMyJobs or ask the operator. If you do not specify a file member, a SAVF
file is assumed. The Process Server will log an error if you simply specify the path to a file that is not of type SAVF
.
To locate a library on an AS/400, run the WRKLIB
command. Note that the library you're looking for may be inside another library (typically QSYS
or QGPL
). Once you have found the library you need to add .LIB
to the end of each of the libraries, and separate them with /
.
For example, if you are looking for physical file members named P*
in file MYFILE.FILE
of the USERX.LIB
library in QSYS
, the file event should be specified as follows.
Directory: /QSYS.LIB/USERX.LIB/MYFILE.FILE
Pattern: P*
The following wildcards are supported:
*
- any number of characters.?
- exactly one character.
You cannot specify wildcards in the library or file part of the path, only on physical file members (after the last /
).
Root (/) File System
The root (/) file system has a hierarchical structure that users of UNIX or Windows will be familiar with.
For example, if you are looking for files named P*
in /home/REDWOOD/incoming
, the file event should be specified as follows.
Directory: /home/REDWOOD/incoming
Pattern: P*
The following wildcards are supported:
*
- any number of characters.?
- exactly one or zero characters.
You cannot specify wildcards on the directory name, only the file name.
Creating Chains to Manage the Deletion of Flag Files
If you cannot use a move directory, you will need to use a Chain and Process Definition to delete the file that triggers the event. To detect and remove files, create a Chain and Process Definition with a wait event that calls the process that should be submitted when the file arrives. In the second Step of this Chain, use a Process Definition that uses the file.delete
action to delete the file after it has arrived.
Troubleshooting
If a check is performed and the file cannot be read (missing authorization, invalid path), the Process Server will create an Operator Message. An Operator Message is also created if the a file move fails.