Sample job streams for BMC AMI Copy data sharing agents
Related topic
BMC AMI Copy data sharing agent
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 DUMMYIn this output, there are 3 agents in the group $ACPDEV. The message BMC160658I indicates pending shutdown because termination might be delayed.
BMC30999I COPY PLUS FOR DB2 V10.1.00
BMC30999I COPYRIGHT BMC SOFTWARE INC. 1991-2023
BMC47487I COPY PLUS TECHNOLOGY IS PROTECTED BY U.S. PATENT 7,133,884
BMC30999I CONTACT BMC SUPPORT AT 1-800-537-1813
BMC30001I UTILITY EXECUTION STARTING 01/08/2011 12:09:59 ...
BMC30002I UTILITY ID = . DB2 SUBSYSTEM ID = .
BMC30008I RESTART PARM = TERMAGENTS
BMC30519I ------------ INSTALLATION OPTIONS ------------------
BMC30519I NAME=ACP$OPTS HISTORY=NO
BMC30519I WKUNIT=SYSALLDA REGWTO=YES
BMC30519I PLANCOPY=ACPB101 PUBLICPLAN=YES
.
.
.
BMC160671I CONNECTING TO XCF GROUP MEMBER ACP1010ASYSO
.
BMC160671I CONNECTING TO XCF GROUP MEMBER ACP1010ASYSI
BMC160671I CONNECTING TO XCF GROUP MEMBER ACP1010ASYSM
.
.
.
BMC160677I MEMBER ACP1010CSYSO LEAVING XCF GROUP $ACPDEV
.
BMC160658I SHUTDOWN OF XCF GROUP $ACPDEV PENDING
BMC30005I UTILITY EXECUTION COMPLETE, RETURN CODE = 0Method 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