CICS VSAM COPY Tool
(Also does Batch!)

By

Don Fowler, MCE, Inc., Sept 2004

 

The VSAM Story

Since before the earth cooled CICS has utilized VSAM flat file structures as a main access method. Billions of development and maintenance dollars, and millions of lines of code revolve around the VSAM architecture.   

 

VSAM has been an excellent mechanism for data and control file architectures, but as with anything else of such vintage, new and more development friendly approaches are slowly beginning to erode the VSAM domain. 

 

This year IBM has brought out CICS VSAM Transparency tool that allows you to move your existing VSAM data under DB2 and still access the data using the existing VSAM APIs in your applications. (See our previous article on the VSAM Transparency tool.)              

 

But what if one does not wish to migrate VSAM to DB2? After all with VSAM Transparency there is a small but inherent overhead associated with simulating the VSAM APIs and translating to DB2 functions.  What about copying VSAM Data Sets while they are open to CICS users?

 

CICS VSAM Copy is designed for creating copies of VSAM data sets while they are under the control of a CICS region.  CICS VSAM Copy allows the creation of point-in-time backup copies of VSAM files concurrently with business-critical on-line processing. Copies are made without interrupting the on-line user, who can continue to update the VSAM data sets being copied.  The on-line CICS user is unaware that the copy takes place, as there is no effect on transaction response time in typical user situations.

 

CICS VSAM Copy

CICS VSAM Copy for z/OS is a VSAM copy utility that allows you to create copies of existing VSAM data sets. The data sets can be allocated and open for update in a CICS region (online copy request) or not allocated to any address space (offline copy request).

CICS VSAM Copy supports two modes of copying data sets. A user may copy a data set in online mode or offline mode. Online mode means that the data set is open for update in a CICS region and can be updated during the copy process. Offline mode means the copy utility attempts to allocate and open the data set according to the parameters specified.

The copy will be processed if the open is successful. Regardless of the copy mode, the resulting output data set is identical to one created in similar circumstances by an IDCAMS REPRO.

  

Online mode copy

The biggest feature of CICS VC is it can produce a consistent, point-in-time copy of a VSAM data set while the data set is being updated via CICS transactions. It does this without interrupting any CICS transactions.

 

The resulting copies do not contain any in-flight units of work (UOWs). The copy is identical to a copy taken while update activity to the data set is quiesced and closed to CICS.

 

Online copy requests are handled via both the copy utility’s address space and the

CICS region. The data is read from the data set by subtasks running in the CICS region’s address space. Data is subsequently written to the output data set by subtasks running in the copy utility’s address space (see Figure 1).

 

Offline mode copy requests

Offline copy requests are processed entirely in the copy utility’s address space and have no interaction with CICS. Offline copy request processing is very similar to IDCAMS REPRO processing. If a consistent, point-in-time copy is required for an offline copy, you must make sure the data set cannot be updated while the offline copy is in progress.

 

Dynamic mode copy

Dynamic mode allows an authorized user to copy a data set without knowing whether a CICS region currently has update access to the data set. When a dynamic mode request is received, CICS VSAM Copy will attempt to satisfy the request as an online copy by trying to locate the data set within a CICS region. If a CICS region that owns the data set is not found, CICS VC will perform an offline mode copy.

 

Types of VSAM data sets supported

CICS VC can create consistent copies for all VSAM KSDS, ESDS, RRDS, and VRRDS data sets.

. 

For online copy requests, the following restrictions apply.

1.      The data set must be of a type supported by CICS.

2.      CICS VC should not be used with any VSAM data sets that can be modified from
more than one CICS address space, e.g., share option 3/4 data sets or data sets
exploiting Record Level Sharing (RLS).

3.      VSAM ESDS data sets with associated alternate indices are not supported.

4.      VSAM KSDS data sets with alternate index paths cannot be copied through a path component.

 

Copy requests for multiple data sets

CICS VSAM Copy can copy multiple VSAM data sets to the same "point in time."
All of these data sets must be owned by the same CICS region.

 

Partial data set copy requests

CICS VSAM Copy can make partial copies of one or more VSAM data sets by using an "RID range" for the data set(s) being copied. This feature is important because it allows a user to create subsets of data sets for test data sets.

Software requirements

·        OS/390 V2R10 or z/OS V1R1 or above

·        CICS Transaction Server V1R3,CICS Transaction Server V2R2 or V2R3

Restrictions / warnings on product usage

The following is a direct quote from the CICS VSAM Copy utility User Guide:
 

CICS VC can create consistent copies for all VSAM KSDS, ESDS, RRDS, and VRRDS data sets. If the data set is under the control of a CICS region during the copy process (referred to as an online copy request), the following restrictions apply.

·        You can only copy VSAM file types supported by CICS. The file must be capable of being processed by standard CICS File Control API commands. The file’s status must be 1) open and enabled, or 2) closed and enabled.

·        Do not use CICS VC to copy CICS system files such as the Global and Local Catalogues, Intrapartition Temporary Storage data set, etc. CICS VC does not detect this scenario. It is up to you to ensure that these types of data sets are not copied by CICS VC.

·        Do not use CICS VC to copy data sets that are accessed via methods other than the standard CICS File Control API commands (for example, native VSAM macros) even if they are defined to CICS. CICS VC does not detect this scenario. It is up to you to ensure that these types of data sets are not copied by CICS VC.

·        Do not use CICS VC with any VSAM data sets that can be modified from more than one CICS address space, e.g., share option 3/4 data sets or data sets exploiting Record Level Sharing (RLS). When a copy request is received for one of these data sets, a warning message is displayed on the system console, and the copy utility continues processing. If you choose to continue with the copy, it is up to you to guarantee that the data set will not be modified outside of the CICS region named in the warning message. CICS VC is unable to detect updates to the data set from other address spaces/regions.

·        CICS VS does not support or detect VSAM ESDS data sets with associated alternate indices. You should be aware of this data set scenario and not attempt to use CICS VC to copy such a data set.

·        VSAM KSDS data sets with alternate index paths cannot be copied through a path component. An attempt to do this will be detected and the copy request will be terminated. CICS VC fully supports copying a VSAM data set with alternate index path(s) through the base cluster and also supports update activity through both the base, and the paths while a copy through the base is in progress.”

 

 

Implementation

The user must install and customize the Copy Server as well as defining the loadmods, maps, transids, and programs to a CICS region. The CICS VC CICS support consists of two transaction IDs, several control programs, CICS global user exit (GLUE) programs, and a program that runs as an MVS subtask within the CICS region’s address space.

  

Summary

This utility has a fairly quick and easy install and implementation process. The capability of online copy without having to take the VSAM component away from CICS is highly advantageous. While the pricing appears to be very inexpensive, you should contact your IBM Business Partner or your IBM account team for pricing specific to your environment. Hint: Your IBM Business Partner is listed on the front page of this newsletter.   

       

Click your browser BACK button to return.