Entry Sequenced Data Set Delete, Define and Adding Records |
The SimoTime Home Page |
This program suite provides an example of how to delete and define a new Entry Sequenced Data Set (ESDS) using Mainframe JCL. Once the new ESDS is created a COBOL program may be used to add records to the data set. You can update records in place, but you cannot delete them. You can get around this by having a "status" field within the record that identifies it as being logically deleted. At some point in time you should copy the file and drop all the logically deleted records. This approach requires all applications that access the data set to know the meaning of the "status" field.
Note: The record length of the replacement record must be the same as the record length of the record being updated.
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-2025
SimoTime Technologies and Services
All Rights Reserved
This section will describe the two JCL members used in this example. The first JCL member will delete and define a new Entry Sequenced Data Set or ESDS. The second JCL member will execute a COBOL program that will add records to the data set.
The following (ES128CJ1.jcl) is a typical example of how to define a new ESDS using the IDCAMS utility program. This JCL member will create a new, empty ESDS.
//ES128CJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* ES128CJ1.JCL - a JCL Member for Batch Job Processing * //* 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 - Delete and Define an ESDS using IDCAMS. //* Author - SimoTime Technologies //* Date - July 24, 2007 //* //* The process will create a new Entry Sequenced Data Set (ESDS). //* //* This set of programs will run on a mainframe under ZOS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express //* or Enterprise Server. //* //STEP0010 EXEC PGM=IDCAMS //SYSIN DD * DEFINE CLUSTER( - NAME(SIMOTIME.ESDS.ESDSC128) - NONINDEXED - SHR(2 3) - CYL(9 9) - VOL(*)) - DATA - (NAME(SIMOTIME.ESDS.ESDSD128) - RECSZ(004 128) - CISZ(8192) - FREESPACE(0 0)) //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //*
The following (ES128UJ1.jcl) is an example of how a COBOL program can be used to add records to an existing ESDS. The program will read a file of eighty byte records and write to an ESDS of 128 byte records. The trailing bytes are padded with spaces. The input is included in stream in the JCL member.
//ES128UJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* ES128UJ1.JCL - a JCL Member for Batch Job Processing * //* 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 - Update an ESDS using a COBOL Program. //* Author - SimoTime Technologies //* Date - July 24, 2007 //* //* Add records to an Entry Sequenced Data Set (ESDS). The records to //* be added are instream in this JCL member. //* //* This set of programs will run on a mainframe under ZOS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express //* or Enterprise Server. //* //* ************ //* * ESU128J1 * //* ********jcl* //* * //* * //* ************ ************ ************ //* * ESD080RS ******* ESD128C1 ******* PUTES128 * //* ********jcl* ********utl* *******esds* //* * //* * //* ************ //* * EOJ * //* ************ //* //* //* //* ******************************************************************* //* Step 1 Delete any previously created file... //* //JOBSETUP EXEC PGM=IEFBR14 //SYSUT2 DD DSN=SIMOTIME.DATA.STRING80,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 2 Create and populate a new QSAM file... //* //RSEQMAKE EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * 00000001 - Hello World 00000002 - Enjoy the trip 00000003 - Good Bye World /* //SYSUT2 DD DSN=SIMOTIME.DATA.STRING80, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 3 of 3 Populate an Entry Sequenced Data Set (ESDS). //* //ESD128S1 EXEC PGM=ESD128C1 //ESD080RS DD DSN=SIMOTIME.DATA.STRING80,DISP=SHR //ESD128D1 DD DSN=SIMOTIME.ESDS.ESDSC128,DISP=MOD //SYSOUT DD SYSOUT=* //*
The following (ES128RJ1.jcl) is a typical example of how to delete and existing ESDS and define a new ESDS using the IDCAMS utility program. This JCL member will create a new, empty ESDS.
//ES128RJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* ES128RJ1.JCL - a JCL Member for Batch Job Processing * //* This JCL 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 * //* ******************************************************************* //* //* Text - Delete and Define an ESDS using IDCAMS. //* Author - SimoTime Technologies //* Date - July 24, 2007 //* //* The process will delete an existing data set and create a new //* Entry Sequenced Data Set (ESDS). If a Data Set does not exist the //* MAXCC statement will set the non-zero condition code back to zero. //* //* This set of programs will run on a mainframe under ZOS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express //* or Enterprise Server. //* //STEP0010 EXEC PGM=IDCAMS //SYSIN DD * DELETE (SIMOTIME.ESDS.ESDSC128) SET MAXCC = 0 DEFINE CLUSTER( - NAME(SIMOTIME.ESDS.ESDSC128) - NONINDEXED - SHR(2 3) - CYL(9 9) - VOL(*)) - DATA - (NAME(SIMOTIME.ESDS.ESDSD128) - RECSZ(128 128) - CISZ(8192) - FREESPACE(0 0)) //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //*
The following (ES128DJ1.jcl) is an example of how to delete an existing ESDS using the IDCAMS utility program.
//ES128DJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* ES128DJ1.JCL - a JCL Member for Batch Job Processing * //* 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 - Delete ESDS using IDCAMS. //* Author - SimoTime Technologies //* Date - July 24, 2007 //* //* The process will delete an existing data set. //* If a Data Set does not exist the MAXCC statement will set the //* non-zero condition code back to zero. //* //* This set of programs will run on a mainframe under ZOS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express //* or Enterprise Server. //* //STEP0010 EXEC PGM=IDCAMS //SYSIN DD * DELETE (SIMOTIME.ESDS.ESDSC128) SET MAXCC = 0 //SYSOUT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //*
This section will describe the Bash Script Files used in this set of jobs. The first Bash Script will delete and define a new Entry Sequenced Data Set or ESDS.
The following (esd128s8.sh) is an example of how to define a new ESDS or QSAM File. This Bash Script File will create a new, empty ESDS.
#!/bin/bash JOBNAME=esd128s8 # * ******************************************************************* # * Bash Script File - provided by SimoTime Technologies * # * (C) Copyright 1987-2018 All Rights Reserved * # * Web Site URL: http://www.simotime.com * # * e-mail: helpdesk@simotime.com * # * ******************************************************************* # * # * Text - Create Test Files and an Empty QSAM or ESDS # * Author - SimoTime Technologies # * Date - November 11, 2003 # * Version - 06.07.16 # * # * This job will create an empty QSAM File or VSAM, ESDS. # * # * # * ************ # * * esd128s3 * # * *********sh* # * * # * * # * ************ ************ # * * echo ******* ESD080TX * # * ************ ********txt* # * * # * * # * ************ # * * cobcrun ***************************** # * ************ * # * * * # * * ************ ************ ************ # * * * ESD080TX ******* CV80ALAR ******* ESD128RS * # * * ********txt* ********cbl* ********dat* # * * # * * # * ************ # * * cobcrun ***************************** # * ************ * # * * * # * * ************ ************ # * * * ESD128C8 ******* ESD128D1 * # * * ********cbl* ********dat* # * * # * ************ # * * EOJ * # * ************ # * # * ******************************************************************** # * Step 1 of 5, Prepare the execution environment... # * for textstring in $(cat ENV4SYS1.txt); do # # * The following statement will replace all occurences # # * of DL_BASESYS1 with the value of the BASESYS1 # # * environment variable. textstring=${textstring//DL_BASESYS1/$BASESYS1} # # * The following statement will replace all occurences # # * of DL_JOBNAME with the value of the JOBNAME # # * environment variable. textstring=${textstring/DL_JOBNAME/$JOBNAME} export $textstring rc=$? if [ $rc != 0 ] then ((NOK_Count++)) simonote.sh "# $textstring - Return Code is $rc" JOBSTATUS=$rc else ((AOK_Count++)) fi done # * simonote.sh "# SIMOSYS1........... $BASESYS1" simonote.sh "# SIMONOTE........... $SIMONOTE" simonote.sh "# COB_LIBS........... $COB_LIBS" simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH" # * simonote.sh "************************************************************$JOBNAME" simonote.sh "# Starting, Job Name is $JOBNAME, User is $USER" # * # * ******************************************************************** # * Step 2 of 5, Prepare the bootstrap text file... # * simonote.sh "# StepInfo, Prepare the bootstrap text file" export ESD080TX=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD080TX.txt echo "A-Record 00001 for Testing of ESDS, Initial">$ESD080TX echo "A-Record 00002 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00003 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00004 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00005 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00006 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00007 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00008 for Testing of ESDS, Initial">>$ESD080TX echo "A-Record 00009 for Testing of ESDS, Initial">>$ESD080TX # * # * ******************************************************************** # * Step 3 of 5, Convert bootstrap text file to Sequential File # * simonote.sh "# StepInfo, Convert bootstrap text file to Sequential File" export GETLS080=$ESD080TX export PUTRS080=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD080RS.dat cobcrun CV80ALAR rc=$? if [ $rc != 0 ] then ((NOK_Count++)) JOBSTATUS=$rc simonote.sh "# ABENDING Job Name is $JOBNAME, Job Status is $JOBSTATUS" exit $JOBSTATUS else ((AOK_Count++)) simonote.sh "# DataMake $ESD128D1" fi # * # * ******************************************************************** # * Step 4 of 5, Create an empty VSAM, ESDS... # * export ESD128D1=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD128D1.dat simonote.sh "# StepInfo, Create an empty VSAM, ESDS" cobcrun ESD128C8 rc=$? if [ $rc != 0 ] then ((NOK_Count++)) JOBSTATUS=$rc simonote.sh "# ABENDING Job Name is $JOBNAME, Job Status is $JOBSTATUS" exit $JOBSTATUS else ((AOK_Count++)) simonote.sh "# DataMake $ESD128D1" fi # * # * ******************************************************************** # * Step 5 of 5, End-of-Job... # * simonote.sh "# Finished, Job Name is $JOBNAME"
The following (esd128s1.sh) is an example of how add records within a VSAM, ESDS or QSAM File.
#!/bin/bash JOBNAME=esd128s1 # * ******************************************************************* # * Bash Script File - provided by SimoTime Technologies * # * (C) Copyright 1987-2018 All Rights Reserved * # * Web Site URL: http://www.simotime.com * # * e-mail: helpdesk@simotime.com * # * ******************************************************************* # * # * Text - Read Sequential and populate VSAM, ESDS or QSAM File # * Author - SimoTime Technologies # * Date - November 11, 2003 # * Version - 06.07.16 # * # * This job will populate a VSAM, ESDS or QSAM File. # * # * # * ************ # * * esd128s1 * # * *********sh* # * * # * * # * ************ # * * cobcrun ***************************** # * ************ * # * * * # * * ************ ************ ************ # * * * ESD080RS ******* ESD128C1 ******* ESD128D1 * # * * *******rseq* ********cbl* ********dat* # * * # * * # * ************ # * * EOJ * # * ************ # * # * ******************************************************************** # * Step 1 of 3, Prepare the environment... # * # * for textstring in $(cat ENV4SYS1.txt); do # # * The following statement will replace all occurences # # * of DL_BASESYS1 with the value of the BASESYS1 # # * environment variable. textstring=${textstring//DL_BASESYS1/$BASESYS1} # # * The following statement will replace all occurences # # * of BASHUSER_JOBNAME with the value of the JOBNAME # # * environment variable. textstring=${textstring/DL_JOBNAME/$JOBNAME} export $textstring rc=$? if [ $rc != 0 ] then ((NOK_Count++)) simonote.sh "# $textstring - Return Code is $rc" JOBSTATUS=$rc else ((AOK_Count++)) fi done # * simonote.sh "# SIMOSYS1........... $BASESYS1" simonote.sh "# SIMONOTE........... $SIMONOTE" simonote.sh "# COB_LIBS........... $COB_LIBS" simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH" # * simonote.sh "************************************************************$JOBNAME" simonote.sh "Starting Job Name is $JOBNAME, User is $USER" # * # * ******************************************************************** # * Step 2 of 3, Read Sequential and populate VSAM, ESDS or QSAM File... # * simonote.sh "StepInfo Read Sequential and populate VSAM, ESDS or QSAM File" export ESD080RS=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD080RS.dat export ESD128D1=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD128D1.dat cobcrun ESD128C1 rc=$? if [ $rc != 0 ] then ((NOK_Count++)) JOBSTATUS=$rc simonote.sh "ABENDING Job Name is $JOBNAME, Job Status is $JOBSTATUS" exit $JOBSTATUS else ((AOK_Count++)) simonote.sh "DataTake $ESD080RS" simonote.sh "DataMake $ESD128D1" fi # * # * ******************************************************************** # * Step 3 of 3, End of Job... # * simonote.sh "Finished Job Name is $JOBNAME"
The following (esd128s2.sh) is an example of how update records within a VSAM, ESDS or QSAM File.
#!/bin/bash JOBNAME=esd128s2 # * ******************************************************************* # * Bash Script File - provided by SimoTime Technologies * # * (C) Copyright 1987-2018 All Rights Reserved * # * Web Site URL: http://www.simotime.com * # * e-mail: helpdesk@simotime.com * # * ******************************************************************* # * # * Text - Update or ReWrite records in a QSAM File or VSAM, ESDS # * Author - SimoTime Technologies # * Date - November 11, 2003 # * Version - 06.07.16 # * # * This job will demonstrate how to update records. One of the updates # * is based on a business requirement. Another update is used to show # * how a record may be flagged for deletion. # * # * # * ************ # * * esd128s2 * # * *********sh* # * * # * * # * ************ # * * cobcrun ***************************** # * ************ * # * * * # * * ************ ************ # * * * ESD128C2 ******* ESD128D1 * # * * ********cbl* ********dat* # * * # * * # * ************ # * * EOJ * # * ************ # * # * ******************************************************************** # * Step 1 of 3, Prepare the environment... # * for textstring in $(cat ENV4SYS1.txt); do # # * The following statement will replace all occurences # # * of DL_BASESYS1 with the value of the BASESYS1 # # * environment variable. textstring=${textstring//DL_BASESYS1/$BASESYS1} # # * The following statement will replace all occurences # # * of BASHUSER_JOBNAME with the value of the JOBNAME # # * environment variable. textstring=${textstring/DL_JOBNAME/$JOBNAME} export $textstring rc=$? if [ $rc != 0 ] then ((NOK_Count++)) simonote.sh "# $textstring - Return Code is $rc" JOBSTATUS=$rc else ((AOK_Count++)) fi done # * simonote.sh "# SIMOSYS1........... $BASESYS1" simonote.sh "# SIMONOTE........... $SIMONOTE" simonote.sh "# COB_LIBS........... $COB_LIBS" simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH" # * simonote.sh "************************************************************$JOBNAME" simonote.sh "Starting Job Name is $JOBNAME, User is $USER" # * # * ******************************************************************** # * Step 2 of 3, Update a VSAM, ESDS or QSAM File... # * export GETES080=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.RSEQ0128.dat export ESD128D1=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD128D1.dat simonote.sh "StepInfo Update a VSAM, ESDS or QSAM File" cobcrun ESD128C2 rc=$? if [ $rc != 0 ] then ((NOK_Count++)) simonote.sh "+ $name - Return Code is $rc" JOBSTATUS=$rc simonote.sh "ABENDING Job Name is $JOBNAME, Job Status is $JOBSTATUS" exit $JOBSTATUS else ((AOK_Count++)) simonote.sh "DataTake $GETES080" simonote.sh "DataMake $ESD128D1" fi export SYSLOG=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.DUMP0128.dat cobcrun SIMOZAPS HEXCESS $ESD128D1 VIEW=1 STOP=99999 # * # * ******************************************************************** # * Step 3 of 3, End of Job... # * simonote.sh "Finished Job Name is $JOBNAME"
The following (esd128s3.sh) is an example of how copy selected records within a VSAM, ESDS or QSAM File.
#!/bin/bash JOBNAME=esd128s3 # * ******************************************************************* # * Bash Script File - provided by SimoTime Technologies * # * (C) Copyright 1987-2018 All Rights Reserved * # * Web Site URL: http://www.simotime.com * # * e-mail: helpdesk@simotime.com * # * ******************************************************************* # * # * Text - Installation Verification Process # * Author - SimoTime Technologies # * Date - November 11, 2003 # * Version - 06.07.16 # * # * This program will simply display a message to the screen. # * # * This technique provides a single set of source code that may be # * compiled and executed on an IBM Mainframe System, a Linux System # * or a UNIX System. # * # * ************ # * * esd128s3 * # * *********sh* # * * # * * # * ************ # * * cobcrun ***************************** # * ************ * # * * * # * * ************ ************ ************ # * * * ESD128D1 ******* ESD128C3 ******* ESD128D2 * # * * ********dat* ********cbl* ********dat* # * * # * ************ # * * EOJ * # * ************ # * # * ******************************************************************** # * Step 1 of 3, Set the environment variables... # * for textstring in $(cat ENV4SYS1.txt); do # # * The following statement will replace all occurences # # * of DL_BASESYS1 with the value of the BASESYS1 # # * environment variable. textstring=${textstring//DL_BASESYS1/$BASESYS1} # # * The following statement will replace all occurences # # * of BASHUSER_JOBNAME with the value of the JOBNAME # # * environment variable. textstring=${textstring/DL_JOBNAME/$JOBNAME} export $textstring rc=$? if [ $rc != 0 ] then ((NOK_Count++)) simonote.sh "# $textstring - Return Code is $rc" JOBSTATUS=$rc else ((AOK_Count++)) fi done # * simonote.sh "# SIMOSYS1........... $BASESYS1" simonote.sh "# SIMONOTE........... $SIMONOTE" simonote.sh "# COB_LIBS........... $COB_LIBS" simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH" # * simonote.sh "************************************************************$JOBNAME" simonote.sh "Starting Job Name is $JOBNAME, User is $USER" # * # * ******************************************************************** # * Step 2 of 3, Copy an ESDS, purge deleted records... # * export ESD128D1=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD128D1.dat export ESD128D2=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.ESD128D2.dat simonote.sh "StepInfo Copy an ESDS, purge deleted records" cobcrun ESD128C3 rc=$? if [ $rc != 0 ] then ((NOK_Count++)) JOBSTATUS=$rc simonote.sh "ABENDING Job Name is $JOBNAME, Job Status is $JOBSTATUS" exit $JOBSTATUS else ((AOK_Count++)) simonote.sh "DataMake $ESD128D2" fi export SYSLOG=$BASESYS1/SIMOSAM1/DEVL/DATA/APPL/SIMOTIME.ESDS.DMP128D2.txt cobcrun SIMOZAPS HEXCESS $ESD128D2 VIEW=1 STOP=99999 # * # * ******************************************************************** # * Step 3 of 3, End of Job... # * simonote.sh "Finished Job Name is $JOBNAME"
The following (ESD128C1.cbl) is a sample COBOL program that will add records to a VSAM, Entry Sequenced Data Set or ESDS.
IDENTIFICATION DIVISION. PROGRAM-ID. ESD128C1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:21:62 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * PRIMARY ESD128RS SEQUENTIAL FIXED 00080 * * * * SECONDARY ESD128D1 SEQUENTIAL VARIABLE 00128 * * 00004 * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT ESD128RS-FILE ASSIGN TO ESD128RS ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS ESD128RS-STATUS. SELECT ESD128D1-FILE ASSIGN TO ESD128D1 ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS ESD128D1-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD ESD128RS-FILE DATA RECORD IS ESD128RS-REC . 01 ESD128RS-REC. 05 ESD128RS-DATA-01 PIC X(00080). FD ESD128D1-FILE DATA RECORD IS ESD128D1-REC RECORDING MODE IS V RECORD VARYING FROM 00004 TO 00128 DEPENDING ON ESD128D1-LRECL . 01 ESD128D1-REC. 05 ESD128D1-DATA-01 PIC X(00128). ***************************************************************** * This program was created with the SYSMASK1.TXT file as input. * * The SYSMASK1 provides for the sequential reading of the input * * file and the sequential writing of the output file. * * * * If the output file is indexed then the input file must be in * * sequence by the field that will be used to provide the key * * for the output file. This is a sequential load process. * * * * If the key field is not in sequence then refer to SYSMASK2 * * to provide for a random add or update of the indexed file. * * * * This program mask will have the ASCII/EBCDIC table inserted * * for use by the /TRANSLATE function of SimoZAPS. * * * * For more information or questions please contact SimoTime * * Technologies. The version control number is 16.01.01 * * * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* ESD128C1 '. 05 T2 pic X(34) value 'Get Record Sequential, Extend ESDS'. 05 T3 pic X(10) value ' v16.01.01'. 05 T4 pic X(24) value ' helpdesk@simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* ESD128C1 '. 05 C2 pic X(32) value 'This Data File Convert Member wa'. 05 C3 pic X(32) value 's generated by SimoTime Technolo'. 05 C4 pic X(04) value 'gies'. 01 ESD128RS-STATUS. 05 ESD128RS-STATUS-L pic X. 05 ESD128RS-STATUS-R pic X. 01 ESD128RS-EOF pic X value 'N'. 01 ESD128RS-OPEN-FLAG pic X value 'C'. 01 ESD128D1-STATUS. 05 ESD128D1-STATUS-L pic X. 05 ESD128D1-STATUS-R pic X. 01 ESD128D1-EOF pic X value 'N'. 01 ESD128D1-OPEN-FLAG pic X value 'C'. 01 ESD128RS-LRECL pic 9(5) value 00080. 01 ESD128D1-LRECL pic 9(5) value 00128. 01 ESD128RS-LRECL-MAX pic 9(5) value 00080. 01 ESD128D1-LRECL-MAX pic 9(5) value 00128. ***************************************************************** * The following buffers are used to create a four-byte status * * code that may be displayed. * ***************************************************************** 01 IO-STATUS. 05 IO-STAT1 pic X. 05 IO-STAT2 pic X. 01 IO-STATUS-04. 05 IO-STATUS-0401 pic 9 value 0. 05 IO-STATUS-0403 pic 999 value 0. 01 TWO-BYTES-BINARY pic 9(4) BINARY. 01 TWO-BYTES-ALPHA redefines TWO-BYTES-BINARY. 05 TWO-BYTES-LEFT pic X. 05 TWO-BYTES-RIGHT pic X. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(011) value '* ESD128C1 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(068) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. 01 MSG-LSB pic 9(5) value 267. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'ESD128C1'. 01 INFO-STATEMENT. 05 INFO-SHORT. 10 INFO-ID pic X(8) value 'Starting'. 10 filler pic X(2) value ', '. 10 filler pic X(34) value 'Get Record Sequential, Extend ESDS'. 05 filler pic X(24) value ' http://www.SimoTime.com'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 WRITE-FLAG pic X value 'Y'. 01 ESD128RS-TOTAL. 05 ESD128RS-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for ESD128RS'. 01 ESD128D1-TOTAL. 05 ESD128D1-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for ESD128D1'. ***************************************************************** PROCEDURE DIVISION. move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move INFO-STATEMENT to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT move all '*' to MESSAGE-TEXT-1 perform Z-DISPLAY-MESSAGE-TEXT perform Z-POST-COPYRIGHT perform ESD128RS-OPEN perform ESD128D1-OPEN * USRSOJ Processing not specified... perform until ESD128RS-STATUS not = '00' perform ESD128RS-READ if ESD128RS-STATUS = '00' add 1 to ESD128RS-RDR perform BUILD-OUTPUT-RECORD if WRITE-FLAG = 'Y' perform ESD128D1-WRITE if ESD128D1-STATUS = '00' add 1 to ESD128D1-ADD end-if end-if end-if end-perform * USREOJ Processing not specified... move ESD128RS-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128D1-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'Complete' to INFO-ID else move 'ABENDING' to INFO-ID end-if move INFO-STATEMENT to MESSAGE-TEXT(1:79) perform Z-DISPLAY-MESSAGE-TEXT perform ESD128D1-CLOSE perform ESD128RS-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. * TransINIT process... move ALL SPACES to ESD128D1-REC * TransCOPY... move ESD128RS-REC(00001:00080) to ESD128D1-REC(00001:00080) exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** ESD128RS-CLOSE. add 8 to ZERO giving APPL-RESULT. close ESD128RS-FILE if ESD128RS-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with ESD128RS' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128RS-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* ESD128RS-READ. read ESD128RS-FILE if ESD128RS-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if ESD128RS-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if if APPL-AOK CONTINUE else if APPL-EOF move 'Y' to ESD128RS-EOF else move 'READ Failure with ESD128RS' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128RS-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* ESD128RS-OPEN. add 8 to ZERO giving APPL-RESULT. open input ESD128RS-FILE if ESD128RS-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to ESD128RS-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with ESD128RS' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128RS-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** ESD128D1-WRITE. if ESD128D1-OPEN-FLAG = 'C' perform ESD128D1-OPEN end-if write ESD128D1-REC if ESD128D1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if ESD128D1-STATUS = '10' add 16 to ZERO giving APPL-RESULT else add 12 to ZERO giving APPL-RESULT end-if end-if. if APPL-AOK CONTINUE else move 'WRITE Failure with ESD128D1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* ESD128D1-OPEN. add 8 to ZERO giving APPL-RESULT. open EXTEND ESD128D1-FILE if ESD128D1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to ESD128D1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with ESD128D1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* ESD128D1-CLOSE. add 8 to ZERO giving APPL-RESULT. close ESD128D1-FILE if ESD128D1-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to ESD128D1-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with ESD128D1' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move ESD128D1-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * The following Z-ROUTINES provide administrative functions * * for this program. * ***************************************************************** * ABEND the program, post a message to the console and issue * * a STOP RUN. * ***************************************************************** Z-ABEND-PROGRAM. if MESSAGE-TEXT not = SPACES perform Z-DISPLAY-MESSAGE-TEXT end-if move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT add 12 to ZERO giving RETURN-CODE STOP RUN. * exit. ***************************************************************** Z-CALCULATE-MESSAGE-LSB. add 267 to ZERO giving MSG-LSB perform until MSG-LSB < 80 or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE if MESSAGE-BUFFER(MSG-LSB:1) = SPACE subtract 1 from MSG-LSB end-if end-perform exit. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. perform Z-CALCULATE-MESSAGE-LSB display MESSAGE-BUFFER(1:MSG-LSB) move all SPACES to MESSAGE-TEXT exit. ***************************************************************** * Display the file status bytes. This routine will display as * * four digits. If the full two byte file status is numeric it * * will display as 00nn. If the 1st byte is a numeric nine (9) * * the second byte will be treated as a binary number and will * * display as 9nnn. * ***************************************************************** Z-DISPLAY-IO-STATUS. if IO-STATUS not NUMERIC or IO-STAT1 = '9' move IO-STAT1 to IO-STATUS-04(1:1) subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY move IO-STAT2 to TWO-BYTES-RIGHT add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403 move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT else move '0000' to IO-STATUS-04 move IO-STATUS to IO-STATUS-04(3:2) move 'File Status is: nnnn' to MESSAGE-TEXT move IO-STATUS-04 to MESSAGE-TEXT(17:4) perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** Z-POST-COPYRIGHT. display SIM-TITLE display SIM-COPYRIGHT exit. ***************************************************************** * This program was generated by SimoZAPS * * A product of SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * * Generation Date: 2018-10-10 Generation Time: 20:28:21:64 * *****************************************************************
The following (WTL128.cbl) is a link to a sample CICS, COBOL program that will add records to a VSAM, Entry Sequenced Data Set or ESDS.
Explore How to Write a message to a Log File from within a CICS application program.
This section describes additional technical details not covered in previous sections of this document.
This document provides information about how to specify and use the Micro Focus COBOL compiler directives that may be required to control program behavior in the Linux, UNIX or Windows environments in a manner compliant with the compiler options and subsequent execution on the Mainframe System.
Explore the Compiler Directives available for the Micro Focus COBOL technologies.
The following compiler directives were used to compile the ESD128C0 program.
DIALECT"OS390" CHARSET"ASCII" ASSIGN"EXTERNAL" IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM filetype"15" ANIM NOOPTIONAL-FILE outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP settings list() noform
Note: The FILETYPE"15" will enable a COBOL program to process a VSAM, ESDS (Entry-Sequenced-Data-Set). A FILETYPE"16" compiler directive would enable a COBOL program to process extended VSAM, ESDS's (Entry-Sequenced-Data-Sets).
The purpose of this example is to show how to create and use a VSAM, Entry Sequenced Data Set (ESDS). 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.
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.
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.
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 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 icon.
Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise 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.
Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.
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.
Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.
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.
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 |
Entry Sequenced Data Set - Delete, Define and Adding Records |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |