Running CHCCLP using the Classic CHCCLP refresh pack

The CHCCLP command-line program is a Java program. The program can be run in z/OS UNIX System Services (USS) or by using a z/OS batch job.

CHCCLP does not require you to deploy a Management Console or Access Server in the z/OS environment. It contains an embedded Access Server that can connect directly to a source and target server. Using the embedded Access Server enables you to create production deployment scripts to run CHCCLP from USS or with a batch job.

The CHCCLP command-line program takes the following optional parameters:

[-i]
Starts the command line processor in interactive mode.
[-f <filename>]
Executes a series of commands from file. Specify the fully qualified path to the file.
[-L <locale>]
Specifies the locale.
[-a]
Starts the command-line processor with embedded Access Server, which runs on default port 10101.
[-ap <port>]
Starts the command-line processor with embedded Access Server which runs on a specified port.
[-log <folder>]
Specifies the log folder location when the command-line processor runs with embedded Access Server.
[key:value]*
Specifies one or more key/value pairs where the key is used in the script as %key%. At runtime, the value is substituted. A key can appear multiple times in the file.
[-b]
Suppresses the interactive session banner.
[-e]
Echos the command when the interactive prompt receives all input at once.
[-la <address>]
Specifies the local address to bind a socket when establishing connections to an existing Access Server. When this parameter is not specified, the operating system determines the network interface.
[-lp <port>]
Specifies the port number for the connection to Access Server. When this parameter is not specified, the operating system selects any open port.

Running CHCCLP from a USS shell

Before running CHCCLP you must setup the PATH, JAVA_HOME, LIB_PATH, and CLASSPATH environment variables. You can change the following example for your environment:

###############################################################
# Change to where java is installed
###############################################################
PATH=/bin:/java8/J8.0/bin:/java8/J8.0/lib
export PATH
JAVA_HOME=/java8/J8.0
export JAVA_HOME
LIBPATH=/lib:/usr/lib:$JAVA_HOME/bin/classic 
export LIBPATH
###############################################################
# Change to where CHCCLP is installed
###############################################################
CLASSPATH=/usr/lpp/datarepl/v11r3m00/chcclprun/lib/chcclp.jar
export CLASSPATH
CLASSPATH=$CLASSPATH:/java8/J8.0/bin
export CLASSPATH
###############################################################
# The following is required for chcclp to generate a PassTicket
CLASSPATH=$CLASSPATH:/usr/include/java_classes/IRRRacf.jar
export CLASSPATH
###############################################################

With these environment variables defined you can then execute CHCCLP by using the following example:

java com.ibm.replication.cdc.scripting.Shell –ap 10101 –f /u/ibmuser/test.chcclp
uid1:SRCUSER pwd1:SRCPSWD uid2:TRGUSER pwd2: TRGPSWD

In this example:

  • com.ibm.replication.cdc.scripting.Shell is the class name for CHCCLP for z/OS
  • 10101 is the port to be used by the embedded Access Server. This port might need to be changed for your environment.
  • /u/ibmuser/test.chcclp is the CHCCLP script that contains the commands to be run.
  • uid1:SRCUSER pwd1:SRCPSWD uid2:TRGUSER pwd2: TRGPSWD are the keywords that you can replace in the script file. For example, all instances of %uid1% in the script file will be replace with SRCUSER.

Running CHCCLP by using JCL

The program is run using the JVMPRC80 Java Batch Launcher procedure. The USERSAMP member CECCHCLP provides example JCL to run CHCCLP.

The JVMPRC80 ARGS parameter is used to provide the optional command-line parameters that are listed above. This parameter is used to provide the host and port information for the Access Server to which the program connects. The sample CECCHCLP member uses an embedded Access Server with ARGS='-ap 10101', which is the default port for the command-line program. You might need to change this port for your environment.

The STDENV DD data set contains the PATH, JAVA_HOME, LIB_PATH, and CLASSPATH environment variables. Change these variables to match your environment.

If you are using the RACF PassTicket option on the connect datastore command, include the IRRRacf.jar file in your CLASSPATH as noted in the CECCHCLP member. The IRRRacf.jar file is usually found in the directory /usr/include/java_classes in the USS environment.

The CHCCLP command-line program processes commands that are included in the STDIN DD data set. You can use standard DD concatenation or inline JCL to construct the commands to be run.

The sample CECCHCLP member demonstrates the following commands:

  • connect datastore to connect to a source and a target datastore by using an embedded Access Server.
  • list datastores to list the datastores available to the user that is currently connected.
  • list subscriptions to list subscriptions that are currently loaded.
  • disconnect datastore to disconnect from the source and target datastores.

These commands can also be used in an input script file when you run CHCCLP from USS.

When you connect to homogeneous replication source and target servers, you provide the user ID that is defined to your z/OS security system along with its password, passphrase, or valid PassTicket.

This user information is passed to the Classic source and target data servers. The user’s identity is validated by the source and target data servers when they are configured to use the SAF exit.

The sample CECCHCLP member contains the following examples to demonstrate the user ID options.

Example: Connecting with a user ID with a password or passphrase

The following example shows you how to connect to the source and target servers by using a user name and password or passphrase. The USER1 must be replaced with a valid z/OS user ID. The PASSWD must be replaced with the password or passphrase for that user ID. The HOSTNAME and 9087 values must be replaced with the correct values for the source and target servers.

chcclp session set to classic replication;
connect datastore name SRCSRVR hostname HOSTNAME port 9087 
   username USER1 password PASSWD 
   context source;
connect datastore name TRGSRVR hostname HOSTNAME port 9087
   username USER1 password PASSWD 
   context target;

Example: Connecting with a user ID with a PassTicket

The following example shows you how to connect to the source and target servers by using a user name and PassTicket. The USER1 must be replaced with a valid z/OS user ID. The SRCAPPL and TRGAPPL must be replaced with the PassTicket application names. The HOSTNAME and 9087 values must be replaced with the correct values for the source and target servers.

chcclp session set to classic replication;
connect datastore name SRCSRVR hostname HOSTNAME port 9087 
   username USER1 
   usePassTicket true applid SRCAPPl
   context source;
connect datastore name TRGSRVR hostname HOSTNAME port 9087
   username USER1 
   usePassTicket true applid TRGAPPl
   context target;

Before exiting CHCCLP you disconnect from the source and target servers by using the following commands:

disconnect datastore name SRCSRVR;
disconnect datastore name TRGSRVR;

The sample CECCHCLP member demonstrate the basics. After you successfully connect to a source and target, you can create subscriptions by using the following example:

list subscriptions filter datastore name SRCSRVR;
add subscription name SUB1;
list subscriptions filter datastore name SRCSRVR;
select subscription name SUB1;
show subscription replication properties;
modify subscription persistency false;
show apply latency thresholds;
modify subscription replication properties
capCacheSize 128 applyCacheSize 256;
show subscription replication properties;

The following example shows how to create a replication mapping:

add replication mapping dsnname DATASETNAME;
list replication mappings;