VSAM Migration Utility

VSAM Migration Utility

VSAM Migration Utility

Author: Vikram Priyadarshi & Raja Ranjan Senapati

Date written (MM/DD/YY): 12/30/98

Projects involved: UGY2KCON

Target readers: Software Professionals in Y2K Projects

Abstract: This tool expands a key sequenced VSAM file as per the cutoff year.

Keywords: VSAM, REXX, KSDS and JCL

H/W Platform: Mainframe, IBM PC

S/W Environment: MVS, TSO, Windows 95

Appln. Type: REXX Application for Mainframe

Project Type: Y2K

Index

Introduction

Input to the Tool

Tool Output

How to run the Tool

Tool Methodology

Scope for Improvement

References

Introduction

In Y2K projects it is often required to expand a Key Sequenced VSAM file (KSDS file) having a date in the key part. This article presents a tool to achieve the same objective in a novel way. The tool comprises of a REXX utility program, a C program & a JCL template.

Input to the Tool

This tool requires following input information from the user

  1. Name of the VSAM file to be expanded.
  2. Name of the new VSAM file to be created.
  3. The Cutoff Year.
  4. The record length of the VSAM file to be expanded.
  5. The position (starting byte) of YY field to be expanded.
  6. The length of the key field of the VSAM file to be expanded.
  7. The position (starting byte) of the key field.

Tool Output

The tool produces an expanded KSDS VSAM file.

How to Run the Tool

The following procedure is to be followed to run the tool:

  1. Download all the files accompanying this tool i.e. expand.rex, creatjcl.c & template.jcl.
  2. Upload the REXX utility program to your mainframe in a suitable pds.
  3. Create the JCL with all the input parameters. This can be done in two ways:
  4. By executing the C program: This is an interactive program, which asks the user for all the inputs to the tool and creates the required JCL.
  5. By making manual modifications to the template JCL: The detailed instruction for making manual modifications is in the template jcl itself.
  6. Upload the JCL to your mainframe and submit it. On successful execution the expanded VSAM file with the desired name will be produced.

Tool Methodology

This tool comprises of a REXX utility program and a JCL. The JCL has five steps and the REXX program is called through it in step 2. The basic flow diagram representing the tool methodology is presented here.

Tool Methedology diagram available in the zipped attachement

The functionality of each of the steps is given below

Step 1) Copy the VSAM file to a flat file.

This is achieved through the REPRO command of the Access Method Services.

Step 2) Expand the flat file.

In this step the REXX program is invoked to expand the file to another flat file. In fact the REXX program is a utility by itself. It can be run in an interactive mode directly from the ISPF TSO prompt. It expands a flat file to another flat file given the Input file name, the Output file name, the cutoff year and the position of the YY field to be expanded.

Step 3) Create the new VSAM file.

The CREATE CLUSTER command of the Access Methods Services is used in this step to allocate a new VSAM file. The characteristic of the old VSAM file is copied through the MODEL parameter and the key length and record length is increased by 2.

Step 4) Sort the expanded flat file on the key field.

The DFSORT utility is used in this step to sort the expanded flat file on the key field. This step is required only if the VSAM file contains dates of both the centuries as per the cutoff year.

Step 5) Load the new VSAM file with records from the sorted flat file.

This is achieved through the REPRO command of the Access Method Services.

This tool creates three temperory flat files named 'X.INFOSYS.FILE1', 'X.INFOSYS.FILE2' and 'X.INFOSYS.FILE3' during execution. It has to be ensured that files with the above names do not exist prior to running the tool. All these temporary flat files are deleted after the successful execution. If however the job abends at any step then some of these files may remain depending upon the step at which the job abends. The old VSAM file is not deleted under any circumstances.

Scope for Improvement

  1. This tool can expand those files having dates stored in character format. The other formats like packed decimal and binary is not supported.
  2. It is not possible to expand files with variable record length through this tool.
  3. At present this tool can expand files having only one date field in the key field. If a file has a composite key having more than one date field then that file has to be expanded in steps with one date field expansion in each step.

References

  1. MVS JCL, Doug Lowe, Mike Murach & Associates, Inc., 1994
  2. REXX in the TSO Environment, Gabriel F. Gargiulo, QED Publishing Group, 1993
  3. VSAM Concepts, Programming & Design, Jay & Hirday Ranade, McGraw Hill, Inc., 1992

Click here to Download the Tool.