It is possible, but not easy. The way I would approach it would be ad the following to the distributed job
NOTIFY JOBEND EVENT(CYBER.CPYSPOOL)
The create the event and associated application
The job(s) in the CPYSPOOL application would need to use REXX to determine of what agent the distributed job ran; the agent name is not available in the %MN (monitor) variables
The rexx woud be something like
REXXON
/* read in the APPL, GEN and JOB info from the CLANG variables */
applname=CLANGVAR('%MNAPPL')
applgen=CLANGVAR('%MNAPPLGEN')
jobname=CLANGVAR('%MNFULLNAME')
/* grab all CSF info for the JOB */
NUM=CSFJOB(jobname,'X')
/* find the relevant entry and set MNAGENT variable */
DO I=1 TO NUM
IF XAPPL.I = applname & XAPPLG.I = applgen THEN DO
txt=" MNAGENT='"XAGENT.I"'"
txt
END
END
REXXOFF
The %MNAGENT variable could then be used as the agent name for a distributed job that performs a copy/ftp of the spool file from the location on the agent node. There are some environment variables you can use within the distributed job to locate the spool file for a job
ESPSPOOLDIR is the top folder of the spool "tree" e.g. /opt/CA/WA_Agent/spool
ESPAPPLMGR can be used top grab the ESP instance name e.g. JavaAgent#tcpip@ESP-ZDT (highlighted bit is what you want)
The spool file for a given job is in
$ESPSPOOLDIR/<ESP instance name>/MAIN/<application>.<generation>/<jobname>
so it should be possible to use some form of file transfer mechanims to upload the spool to the mainframe
Original Message:
Sent: 10-25-2021 01:23 PM
From: Jim Susich
Subject: Move distributed spool output to a mainframe dataset
Can the spool file output seen when using the WSF command be moved to a GDG or flat file?