Sample job streams for BMC AMI Copy data sharing agents
Start Agents
Start an BMC AMI Copy agent on each MVS on which a Db2 member of the data sharing group is active. The following example can be found in member ACPAGENT in the HLQ.ACPSAMP data set (where HLQ is the high-level qualifier used during installation).
//ACPAGENT JOB (5217),'COPY+',NOTIFY=&SYSUID,CLASS=A,MSGCLASS=X,
// MSGLEVEL=(1,1)
//* FOR JES3, CODE //*MAIN SYSTEM=SYSI INSTEAD OF JOBPARM
/*ROUTE XEQ BMCPLX0
/*JOBPARM SYSAFF=SYSI
//*********************************************************************
//* EXECUTE AGENT ON SYSI AS A BATCH JOB
//*********************************************************************
//ACPSYSI EXEC PGM=ACPXSTC,REGION=0M,TIME=1440,ACCT=5217
//STEPLIB DD DISP=SHR,DSN=product.libraries <== COPY PLUS LOAD LIBRARY
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//
//*********************************************************************
//* EXECUTE AGENT ON SYSI AS A STARTED TASK
//*********************************************************************
//ACPSYSI EXEC PGM=ACPXSTC,REGION=0M,TIME=1440,ACCT=5217
//STEPLIB DD DISP=SHR,DSN=
product.libraries <== COPY PLUS LOAD LIBRARY
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*Run the backup job(s).
//ACPCOPY JOB (PACP),'COPY+',NOTIFY=&SYSUID,CLASS=A,MSGCLASS=X,
// MSGLEVEL=(1,1)
//*************************************************
//* MAKE COPIES WITH COPY PLUS
//*************************************************
//ACPCOPY EXEC PGM=ACPMAIN,REGION=0M,
// PARM='DBJ,,NEW/RESTART'
//STEPLIB DD DISP=SHR,DSN=product.libraries
// DD DISP=SHR,DSN=DB2.DSNEXIT
// DD DISP=SHR,DSN=DB2.DSNLOAD
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
OUTPUT LOCAL UNIT CART STACK YES
COPY TABLESPACE ACPDB*.*
SHRLEVEL CHANGE COPYDDN(LOCAL) RESETMOD NO
/*(Optional) Terminate agents.
Termination of the agents is not necessary or recommended, especially if they are running as started tasks. However, you can use the following methods to terminate the agents if required.
Only members of your group as specified in the XCFGROUP installation option with the same version as the BMC AMI Copy program are terminated.
Only group members and agents that are not busy are terminated. If an agent is busy with a copy job, the agent waits until it is no longer busy to terminate.
Use one of the following methods:
Method 1: Terminate via BMC AMI Copy restart parameter
The TERMAGENTS restart parameter instructs BMC AMI Copy to identify any BMC AMI Copy agents connected to the XCF group and issue a TERMINATE call to them. (For more information, see BMC-AMI-Copy-installation-options-for-data-sharing.) No other processing is done by BMC AMI Copy. Note that a subsystem ID is not needed because BMC AMI Copy does not connect to Db2.
//*************************************************
//* TERMINATE COPY PLUS AGENTS - ALL SYSTEMS
//*************************************************
//TERMAGNT EXEC PGM=ACPMAIN,REGION=0M,
// PARM=',,TERMAGENTS'
//STEPLIB DD DISP=SHR,DSN=product.libraries
// DD DISP=SHR,DSN=DB2.DSNEXIT
// DD DISP=SHR,DSN=DB2.DSNLOAD
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMYMethod 2: Terminate via MVS command
Method 2 is used to terminate a single agent, whereas Method 1, the TERMAGENTS job, terminates all agents. Also, Method 2 terminates the agent immediately, while Method 1 allows work to progress to finish.
The following MVS commands can be used to terminate the agent if it is executed as a batch job:
f jobName,TERMThe following MVS command can be used to terminate the agent if it is executed as a started task:
f stepName,TERM or p stepName
(Optional) Display All Agents
This job displays all agents. The requirements for this job are the same as those for the job to terminate the agents.
Only agents with the same version as the BMC AMI Copy program are displayed.
//*************************************************
//* DISPLAY COPY PLUS AGENTS - ALL SYSTEMS
//*************************************************
//SHOWAGNT EXEC PGM=ACPMAIN,REGION=0M,
// PARM=',,SHOWAGENTS'
//STEPLIB DD DISP=SHR,DSN=
product.libraries
// DD DISP=SHR,DSN=DB2.DSNEXIT
// DD DISP=SHR,DSN=DB2.DSNLOAD
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMYThe table below describes how the member name in the SYSPRINT is derived:
Characters
Description
1 - 3
Product code
4 - 7
Version number
8
Agent indicator
9 - 16
MVS System where the agent is running