IDCAMS, DELETE/DEFINE
Dynamically Change the DSN Name
  Table of Contents  v-24.01.01 - jclcam01.htm 
  Introduction
  Overview of Sample Application
  The JCL Member
  The JCL INCLUDE Member
  The SYSIN Member for IDCAMS
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This example describes how to use a single JCL Member and IDCAMS to create VSAM Clusters with unique data set names. When creating a VSAM Cluster for a Keyed-Sequenced-Data-Set (a KSDS or other types such as ESDS) using IDCAMS the Data Set Name (or DSN) must be explicitly defined. In other words, JCL substitution cannot be done within the SYSIN parameters for IDCAMS. However, this does not prevent us from accomplishing the task, it just presents a bigger challenge.

In this example we want to show how a single JCL Member can be used to create a VSAM Cluster with the high-level qualifier of the Data Set Name (DSN) being defined by an external value. Since the DSN must be explicitly defined within the SYSIN for IDCAMS the substitution must take placed prior to executing IDCAMS. To do this we are going to use a primary (or template) set of specifications. We will use a COBOL program to read the primary set of specifications and substitute a new high-level qualifier based on a parameter passed via the PARM= on the EXEC statement. A new set of specifications will be created using the temporary data set capability of JCL. This new set of specifications will be used by a subsequent job step that executes IDCAMS to create the VSAM Cluster with a user-defined high-level qualifier in the Data Set Name (or DSN).


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Overview of Sample Application

The following is an overview of the four job steps for this suite of programs.

             
JCLCAMV1
jcl
Start the processing to create and populate a new VSAM, KSDS with a unique, user-defined name
   
JCLCAMS1
pdsm
 
 
RR80RSEQ
cbl
 
 
&&CAMSINFO
rseq/tds
Read Primary Specifications File and create a new, temporary Specifications File
   
&&CAMSINFO
rseq/tds
 
 
IDCAMS
utl
 
 
VSAMK512
ksds
Create a VSAM Cluster with a Unique Data Set Name - MIFODATA.DATA.CUSTK512
   
INSTREAM
jcl
 
 
IEBGENER
utl
 
 
CUST0080
rseq/tds
Create a Sequential file of customer information using a Temporary Data Set (tds)
   
CUST0080/tds
rseq/tds
 
 
CUSI80C1
cbl
 
 
VSAMK512
ksds
Populate the VSAM KSDS using data from the Sequential file
   
EOJ
End-Of-Job
 
Create a VSAM Cluster with a Unique High-Level Qualifier in the Data Set Name (or DSN)

Table of Contents Previous Section Next Section The JCL Member

This sample JCL member (JCLCAMV1.jcl) is a four step job. The first two steps create the VSAM cluster and the second two steps populate the VSAM Data Set. The first job step (REPROREP) will create a new temporary data set. The second job step (KSDSMAKE) will use the temporary data set to DELETE/DEFINE a VSAM Cluster with the new name. The third job step (QSAMCRT1) will create a sequential file containing customer data and the fourth and final job step (KSDSLOAD) will populate the VSAM data set.

The techniques used in this JCL Member will allow the job to do repeated executions without having to clean-up work files. The DELETE/DEFINE in the SYSIN for IDCAMS and the use of temporary data sets using the &&datasetname notation provides this functionality.

//JCLCAMV1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=&SYSUID
//* *******************************************************************
//*       This JCL member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2019 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Text   - Create an empty VSAM, KSDS data set using IDCAMS.
//* Author - SimoTime Technologies
//* Date   - January 24, 1996
//*
//* This job will delete an existing VSAM Cluster and Define a new
//* VSAM Cluster. The VSAM, KSDS data set will have a key of twelve
//* characters starting at the first position in the record.
//* The record length will be 512 characters.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//*
// INCLUDE MEMBER=SETPARMS
//*
//* Step 1 of 4, Prepare to Create a VSAM Cluster.
//*
//* This job step will execute a COBOL program that reads a primary
//* PDSM and creates a new sequential file that substitutes the PARM=
//* value for the SIMOTIME literal in the primary PDSM.
//* The new sequential file is a temporary data set used in a
//* subsequent job step.
//*
//REPROREP EXEC PGM=RR80RSEQ,PARM=&DSNAME01
//GETRS080 DD  DISP=SHR,DSN=&DSNAME01..PDS.PARMLIB(JCLCAMS1)
//PUTRS080 DD  DSN=&&CAMSINFO,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step 2 of 4, DELETE/DEFINE a VSAM Cluster.
//*
//* This job step will execute IDCAMS. The SYSIN for IDCAMS is the
//* specifications file (temporary data set) created in a previous
//* job step.
//*
//KSDSMAKE EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DISP=SHR,DSN=&&CAMSINFO
//SYSOUT   DD  SYSOUT=*
//*
//* *******************************************************************
//* Step 3 of 4, Create and populate a new QSAM file...
//*
//* This job step executes IEBGENER. The input data is instream and the
//* output is a sequential file of 80-byte, fixed length records. The
//* output file is a Temporary Data Set used by a subsequent job step.
//*
//QSAMCRT1 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7. ..:....8
//SYSUT1   DD  *
000100 Anderson       Adrian    1113 Peachtree Plaza    Atlanta        GA 26101
000200 Brown          Billie    224 Baker Boulevard     Baltimore      MD 35702
000300 Carson         Cameron   336 Crenshaw Blvd.      Cupertino      CA 96154
000400 Davidson       Dion      448 Main Street         Wilmington     DE 27323
000500 Everest        Evan      55 5TH Avenue           New York       NY 10341
000600 Franklin       Francis   6612 66TH Avenue        Bedrock        NY 11903
000700 Garfunkel      Gwen      777 77TH Street         New York       NY 16539
000800 Harrison       Hilary    888 88TH Street         Pocatello      ID 79684
000900 Isley          Isabel    999 99TH Avenue         Indianapolis   IN 38762
001000 Johnson        Jamie     1010 Paradise Drive     Larkspur       CA 90504
001100 Kemper         Kelly     1111 Oak Circle         Kansas City    KS 55651
001200 Lemond         Lesley    1212 Lockwood Road      Mohave Desert  AZ 80303
001300 Mitchell       Marlow    1313 Miller Creek Road  Anywhere       TX 77123
001400 Newman         Noel      1414 Park Avenue        Santa Monica   CA 90210
001500 Osborn         Owen      1515 Center Stage       Rolling Rock   PA 36613
001600 Powell         Pierce    PO Box 1616             Ventura        CA 97712
001700 Quigley        Quincy    1717 Farm Hill Road     Oshkosh        WI 43389
001800 Ripley         Ray       1818 Alien Lane         Wayout         KS 55405
001900 Smith          Sammy     1919 Carnoustie Drive   Novato         CA 94919
002000 Tucker         Taylor    2020 Sanger Lane        St. Paul       MN 43998
002100 Underwood      Ulysses   2121 Wall Street        New York       NY 17623
002200 Van Etten      Valerie   2222 Vine Street        Hollywood      CA 98775
002300 Wilson         Wiley     2323 Main Street        Boston         MA 01472
002400 Xray           Xavier    2424 24TH Street        Nashville      TN 44190
002500 Young          Yanni     2525 Yonge Street       Toronto        ON 6B74A6
002600 Zenith         Zebulon   2626 26TH Street        Dallas         TX 71922
123456 Doe            John      123 Main Street         Anywhere       OR 88156
/*
//SYSUT2   DD  DSN=&&CUST0080,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS)
//* *******************************************************************
//* Step 4 of 4, Read the Sequential File, Update the VSAM KSDS.
//*
//* This job step will execute a COBOL program that reads a sequential
//* file that is a Temporary Data Set created in a previous job step.
//* The data from the sequential file is reformatted and used to update
//* or populate the VSAM, KSDS created in a previous job step.
//*
//KSDSLOAD EXEC PGM=CUSI80C1
//CUST0080 DD  DSN=&&CUST0080,
//             DISP=SHR
//CUSTMAST DD  DSN=&DSNAME01..DATA.VSAMK512,
//             DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section The JCL INCLUDE Member

This sample JCL INCLUDE member (SETPARMS.inc) provides a set of substitution values. Its purpose is to provide a single point to define variables that are used by various jobs.

//* *******************************************************************
//*    This JCL Include Member is provided by SimoTime Technologies   *
//*           (C) Copyright 1987-2018 All Rights Reserved             *
//*             Web Site URL:   http://www.simotime.com               *
//*                   e-mail:   helpdesk@simotime.com                 *
//* *******************************************************************
//*
//* Subject: SET a group of shared substitution parameters
//* Author:  SimoTime Technologies
//* Date:    January 1,1998
//*
//       SET   DSNAME01=MIFODATA
//       SET   DSNAME02=DATA
//       SET   DSNAME03=WORKFILE
//*
//* *******************************************************************
//*

Table of Contents Previous Section Next Section The SYSIN Member for IDCAMS

The actual SYSIN Member used by the job step that executes IDCAMS is a Temporarily Data Set created using the DSN=&&DATASETNAME notation. The job step preceding the execution of IDCAMS creates the temporary data set by executing a COBOL program that reads a Partitioned Data Set Member (PDSM) that is used as a template. The COBOL program searches for the "SIMOTIME" literal and replaces it with a user defined value. The following (JCLCAMS1.ctl) shows the content of the PDSM that is named JCLCAMS1.CTL.

 /* **************************************************************** */
 /*            SYSIN Specifications for use with IDCAMS              */
 /*         This Member is provided by SimoTime Technologies         */
 /*           (C) Copyright 1987-2016 All Rights Reserved            */
 /*             Web Site URL:   http://www.simotime.com              */
 /*                   e-mail:   helpdesk@simotime.com                */
 /* **************************************************************** */
 DELETE             SIMOTIME.DATA.VSAMK512
 SET       MAXCC = 0
 DEFINE    CLUSTER  (NAME(SIMOTIME.DATA.VSAMK512)             -
                    KEYS(12,0)                                -
                    RECORDSIZE(512,512)                       -
                    REUSE                                     -
                    TRACKS(45,15))                            -
           DATA     (NAME(SIMOTIME.DATA.VSAMK512.DAT)         -
                    FREESPACE(10,15)                          -
                    CISZ(8192))                               -
           INDEX    (NAME(SIMOTIME.DATA.VSAMK512.IDX))

The following shows the JES output with the substituted values that are actually used by the job step that does the IDCAMS execution.

                Micro Focus MFJAMS Utility 6.0.001


                 /* **************************************************************** */
                 /*            SYSIN Specifications for use with IDCAMS              */
                 /*         This Member is provided by SimoTime Enterprises          */
                 /*           (C) Copyright 1987-2011 All Rights Reserved            */
                 /*             Web Site URL:   http://www.simotime.com              */
                 /*                   e-mail:   helpdesk@simotime.com                */
                 /* **************************************************************** */

                 DELETE             MIFODATA.DATA.VSAMK512

 JCLAM0114I(00) - ENTRYNAME DELETED [MIFODATA.DATA.VSAMK512]

                 SET       MAXCC = 0
 JCLAM0141I(00) - MAXCC set to 0.

                 DEFINE    CLUSTER  (NAME(MIFODATA.DATA.VSAMK512)             -
                                    KEYS(12,0)                                -
                                    RECORDSIZE(512,512)                       -
                                    REUSE                                     -
                                    TRACKS(45,15))                            -
                           DATA     (NAME(MIFODATA.DATA.VSAMK512.DAT)         -
                                    FREESPACE(10,15)                          -
                                    CISZ(8192))                               -
                           INDEX    (NAME(MIFODATA.DATA.VSAMK512.IDX))
 JCLAM0113I(00) - ENTRYNAME DEFINED [MIFODATA.DATA.VSAMK512]
 JCLAM0113I(00) - ENTRYNAME DEFINED [MIFODATA.DATA.VSAMK512.DAT]
 JCLAM0113I(00) - ENTRYNAME DEFINED [MIFODATA.DATA.VSAMK512.IDX]

Table of Contents Previous Section Next Section Summary

This example describes how to use a single JCL Member and IDCAMS to create VSAM Clusters with unique data set names. This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies.

SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.

Table of Contents Previous Section Next Section Downloads and Links

This section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection.

Note: A SimoTime License is required for the items to be made available on a local system or server.

Table of Contents Previous Section Next Section Current Server or Internet Access

The following links may be to the current server or to the Internet.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SimoTime Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
IDCAMS with DELETE/DEFINE and Dynamically Changing the DSN Name
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com