To copy a spool to a file, you can use CPYFRMSPLF.
To copy a file to an IFS directory, you can use CPYTOSTMF or CPYTOIMPF
To monitor qsysopr, you can use a tool such as http://jplamontre.free.fr/AS400/SurveillerQsysopr.htm
from this CLP (that currently resends messages) you can derive a solution that “sends” the message to a file with something like
EXECUTESQL SQL(‘CREATE TABLE QTEMP/mess AS (
SELECT ‘Oh, what a pretty message’ from qsqptabl) WITH DATA’)
cpytoimpf …mess… …myfolder/amessage…
the IFS folder you send the file can be located on another server if you create it in the QNTC file system (if you need details, feed back).
you can find executesql at http://jplamontre.free.fr/jpltools.htm