DONE:
RETURN
CHGVAR VAR(&CPYR) VALUE(&CPYR)
ENDPGM
3. Create the program and put it in the QSYS library:
CRTCLPGM PGM(QSYS/program-name)
SRCFILE(QGPL/QCLSRC) SRCMBR(program-name)
Note: The start-up program runs under user profile QPGMR. By default,
QPGMR does not have authority to change the AS/400 message adapter
commands and programs. You must either grant QPGMR authority to
change the commands and programs (see “Starting the Adapter” on
page 45) or have the start-up program adopt QSECOFR authority and be
owned by QSECOFR.
Multiple AS/400 Message Queues
To support another AS/400 message queue, create the following additional files:
v Configuration file: specifies a different message queue for the MsgQueue
keyword and any new filters
v CDS file: defines new classes to match the messages being monitored
v BAROC file: required if new classes are identified in the CDS file
Configuration File
To create the configuration file, perform the following steps:
1. Copy the adapter files using the following commands:
CPYF FROMFILE(QUSRSYS/CFG_MSG)
TOFILE(QUSRSYS/MYFILE) FROMMBR(*ALL)
TOMBR(*FROMMBR) CRTFILE(*YES)
2. Update the configuration file to show the keywords pointing to the new objects
as follows:
AdapterCdsFile=/QSYS.LIB/QUSRSYS.LIB/MYFILE.FILE/MYCDS.MBR
MsgQueue=QUSRSYS/MYMSGQ
3. Update the CDS and the BAROC files to include any new classes and filters.
4. On the event server, import the BAROC file into the rule base; then, compile
and load the rule base.
5. Start the adapter using the new configuration files as follows:
STRTECADP EVTADP(MYEVTADP)
CFGFILE(’/QSYS.LIB/QUSRSYS.LIB/MYFILE.FILE/MYCFG.MBR’)
Using FTP to Execute AS/400 Commands
You can execute AS/400 commands from an FTP session. This can be useful for
replying to inquiry messages. The following is an example of how to use FTP to
remotely respond to an AS/400 inquiry message based on the message key that is
part of the event string:
quote "RCMD SNDRPY MSGKEY(X’00022A00’) MSGQ(QSYSOPR) RPY(’The reply’) RMV(*NO)”
Chapter 3. AS/400 Message Adapter 53