Dynamic File Allocation Execute a COBOL program in a Batch Job |
The SimoTime Home Page |
This suite of programs and documentation will describe and demonstrate the dynamic file allocation function for the Micro Focus Studio and Server environments. The job will read a file containing a list of file names and copy all the files in the list into a single output file. The files in the list will be dynamically allocated and the output file is allocated using a DD statement in the this JCL member.
Note: The files used in this example are record sequential files with 80-character, fixed length records.
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
The following shows the logic flow to prepare the test files, do the dynamic file allocations, compare the results and clean-up (or delete) the test files.
Color Associations: The Program ObjectivesThis example illustrates the following functions.
Program RequirementsThis suite of samples programs will run on the following platforms.
Execute, Describe Dynamic File Allocation by ExampleThis section will focus on two jobs that do dynamic file allocation. A third job is provided as a referencence and uses standard DD statements to allocate the files. Execute, Dynamic File Allocation using a PDSM ListThe first job wil get a list of input file names from a PDS Member. Each input file will be dynamically allocated, processed and de-allocated. As the records are read from the multiple input files they are copied (or written) to a single output file. The following (DARS80J1.jcl) is the JCL member used to execute this job. //DARS80J1 JOB (SIMOTIME),'MFSYSMOD DEMO',CLASS=1,MSGCLASS=0, // NOTIFY=CSIP1 //* ******************************************************************* //* DARS80J1.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 - Demonstrate Dynamic File Allocation, Micro Focus Server. //* File copy with multiple inputs and a single output. //* The list of input files is obtained from a PDS Member. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* This job and the associated documentation will describe and //* demonstrate dynamic file allocation for the Micro Focus Studio //* and Server environments. //* //* The job will read a file containing a list of file names and //* copy all the files in the list into a single output file. //* The files in the list will be dynamically allocated and the output //* file is allocated using a DD statement in the this JCL member. //* //* Note: The files used in this example are record sequential files //* with 80-character, fixed length records. //* //* ************ //* * DARS80J1 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * DATALIST *-----* DARS80C1 *-----* DATA80P1 * //* ********dat* * * call * ********dat* //* * * DYNAJDDI * //* * ********cbl* //* * * //* ************ * * //* * DYNALLOC *--* * //* ************ * //* * //* ************ //* * EOJ * //* ************ //* //* Note: The DYNAJDDI program is a special Micro Focus COBOL //* program that does Dynamic File Allocation and is unique //* to the Micro Focus environment. This replaces the //* Assembler routine that is used on the mainframe. //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //GETREADY EXEC PGM=IEFBR14 //DATA80P1 DD DSN=MFSYSMOD.DATA.DATA80P1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Concatenate the list of files into a single file. //* A PDS Member is used for the list of file names. //* //DOIT80S2 EXEC PGM=DARS80C1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB,DISP=SHR //DATALIST DD DSN=SIMOTIME.PDS.PARMLIB(DARS80DL),DISP=SHR //PUTRS080 DD DSN=MFSYSMOD.DATA.DATA80P1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //SYSOUT DD SYSOUT=* // Note: The following shows the content of the PDS member (DARS80DL.ctl) that contains the list of files to be dynamically allocated. GETRS080,MFSYSMOD.DATA.DATA80G1 GETRS080,MFSYSMOD.DATA.DATA80G2 GETRS080,MFSYSMOD.DATA.DATA80G3 Execute, Dynamic File Allocation using an Instream ListThe second job wil get a list of input file names from in-stream data embedded in the JCL Member. Each input file will be dynamically allocated, processed and de-allocated. As the records are read from the multiple input files they are copied (or written) to a single output file. The following (DARS80J2.jcl) is the JCL member used to execute this job. //DARS80J2 JOB (SIMOTIME),'MFSYSMOD DEMO',CLASS=1,MSGCLASS=0, // NOTIFY=CSIP1 //* ******************************************************************* //* DARS80J2.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 - Demonstrate Dynamic File Allocation, Micro Focus Server. //* File copy with multiple inputs and a single output. //* The list of input files is obtained from In-Stream Data. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* This job and the associated documentation will describe and //* demonstrate dynamic file allocation for the Micro Focus Studio //* and Server environments. //* //* The job will read a file containing a list of file names and //* copy all the files in the list into a single output file. //* The files in the list will be dynamically allocated and the output //* file is allocated using a DD statement in the this JCL member. //* //* Note: The files used in this example are record sequential files //* with 80-character, fixed length records. //* //* ************ //* * DARS80J2 * //* ********jcl* //* * //* ************ //* * IEFBR14 * //* ********utl* //* * //* ************ ************ ************ //* * DATALIST *-----* DARS80C1 *-----* DATA80P2 * //* ********dat* * * call * ********dat* //* * * DYNAJDDI * //* * ********cbl* //* * * //* ************ * * //* * DYNALLOC *--* * //* ************ * //* * //* ************ //* * EOJ * //* ************ //* //* Note: The DYNAJDDI program is a special Micro Focus COBOL //* program that does Dynamic File Allocation and is unique //* to the Micro Focus environment. This replaces the //* Assembler routine that is used on the mainframe. //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //GETREADY EXEC PGM=IEFBR14 //DATA80P1 DD DSN=MFSYSMOD.DATA.DATA80P2,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, Concatenate the list of files into a single file. //* In-Stream data is used for the list of file names. //* //DOIT80S2 EXEC PGM=DARS80C1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB,DISP=SHR //DATALIST DD * GETRS080,MFSYSMOD.DATA.DATA80G1 GETRS080,MFSYSMOD.DATA.DATA80G2 GETRS080,MFSYSMOD.DATA.DATA80G3 /* //PUTRS080 DD DSN=MFSYSMOD.DATA.DATA80P2, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //SYSOUT DD SYSOUT=* // Execute, File Copy/Concatenate using Standard DD StatementsThis is an optional job that is provided as a reference point. If the names of the files being processed are static then using the standard file concatenation may be the preferred choice for copying three sequential files into a single sequential file. The following (DARS80J7.jcl) is the JCL member used to execute this job. //DARS80J7 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* DARS80J7.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 - Copy three concatenated data sets into one data set. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* Step 1, DISPOSAL will delete any previously created file. //* Step 2, DUPE80S2 will create a new concatenated file. //* //* This job uses instream sorting specifications. //* //* This set of programs will run on a mainframe under ZOS or on a //* Windows System and Micro Focus Enterprise Server or Studio. //* //* 1. Demonstrate how to use IEFBR14 with DD statements to delete //* files that have been created by a previous execution of this //* job. //* 2. Demonstrate how to use JCL with concatenated data sets and //* a COBOL Program to copy three record sequential file with //* eighty (80) byte fixed length records into a single file. //* //* ******************************************************************* //* Step 1 of 2, Delete any previously created file... //* //DISPOSAL EXEC PGM=IEFBR14 //DATA80P7 DD DSN=MFSYSMOD.DATA.DATA80P7,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 2, DUPE input, create a new concatenated output file... //* //DUPE80S2 EXEC PGM=DUPE8080 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //DUPEGET1 DD DSN=MFSYSMOD.DATA.DATA80G1,DISP=SHR // DD DSN=MFSYSMOD.DATA.DATA80G2,DISP=SHR // DD DSN=MFSYSMOD.DATA.DATA80G3,DISP=SHR //DUPEPUT1 DD DSN=MFSYSMOD.DATA.DATA80P7, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //SYSOUT DD SYSOUT=* Prepare, Review and Clean-upThis section will focus on the supporting tasks required to create and refresh the environment so the jobs that do dynamic file allocation may be executed multiple times and produce the same results. Prepare, Create the Test FilesThe following (DARS80J8.jcl) will create the three test files that will be used as input for the demonstration programs. The test files are record sequential files with eighty (80) byte, fixed-length records. //DARS80J8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* DARS80J8.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 - Create a Sequential Data Set on disk using IEBGENER. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The first job step (DISPOSAL) will delete any previously created //* file. The remaining job steps (DATA80F1, DATA80F2 and DATA80F3) //* will create a set of new test files. //* //* This job will run on a Mainframe System with ZOS or a //* Windows System with Micro Focus Enterprise Server. //* //* ******************************************************************* //* Step 1 of 4, Delete any previously created files... //* //DISPOSAL EXEC PGM=IEFBR14 //DATA80G1 DD DSN=MFSYSMOD.DATA.DATA80G1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //DATA80G2 DD DSN=MFSYSMOD.DATA.DATA80G2,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //DATA80G3 DD DSN=MFSYSMOD.DATA.DATA80G3,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 2 of 4, Create and populate a new Record Sequential file... //* //MAKE80F1 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * FILE-001, RECORD-001 FILE-001, RECORD-002 FILE-001, RECORD-003 /* //SYSUT2 DD DSN=MFSYSMOD.DATA.DATA80G1, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 3 of 4, Create and populate a new Record Sequential file... //* //MAKE80F2 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * FILE-002, RECORD-001 FILE-002, RECORD-002 FILE-002, RECORD-003 /* //SYSUT2 DD DSN=MFSYSMOD.DATA.DATA80G2, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) //* //* ******************************************************************* //* Step 4 of 4, Create and populate a new Record Sequential file... //* //MAKE80F3 EXEC PGM=IEBGENER //SYSPRINT DD SYSOUT=* //SYSIN DD DUMMY //* :....1....:....2....:....3....:....4....:....5....:....6....:....7. //SYSUT1 DD * FILE-003, RECORD-001 FILE-003, RECORD-002 FILE-003, RECORD-003 /* //SYSUT2 DD DSN=MFSYSMOD.DATA.DATA80G3, // DISP=(NEW,CATLG,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,DSORG=PS) // Review, Compare Output Test FilesThe following (DARS80J5.jcl) is the JCL member used to execute the program that compares the two output files. //DARS80J5 JOB (SIMOTIME),'MFSYSMOD DEMO',CLASS=1,MSGCLASS=0 //* ******************************************************************* //* DARS80J5.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 * //* ******************************************************************* //* //* Subject: Compare two Files with 80-byte records. //* Author: SimoTime Technologies //* Date: January 24, 1996 //* //* ******************************************************************* //* Step 1 of 1, Compare two Files //* //EXECUTE EXEC PGM=CP80RSC1 //SYSUT1 DD DSN=MFSYSMOD.DATA.DATA80P1,DISP=SHR //SYSUT2 DD DSN=MFSYSMOD.DATA.DATA80P2,DISP=SHR //SYSOUT DD SYSOUT=* //* Dispose, Remove the Test FilesThe following (DARS80J9.jcl) will delete the test files created by this suite of programs. The test files are record sequential files with eighty (80) byte, fixed-length records. //DARS80J9 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* DARS80J9.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 the DATA80Gn and DATA80Pn set of Sequential Files. //* Author - SimoTime Technologies //* Date - January 24, 2005 //* //* This is a single step job that will delete the test files. //* //* This job will run on a Mainframe System with ZOS or a //* Windows System with Micro Focus Enterprise Server. //* //* ******************************************************************* //* Step 1 of 1, Delete files created from a Previous Job Execution. //* //DISPOSAL EXEC PGM=IEFBR14 //DATA80G1 DD DSN=MFSYSMOD.DATA.DATA80G1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //DATA80G2 DD DSN=MFSYSMOD.DATA.DATA80G2,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //DATA80G3 DD DSN=MFSYSMOD.DATA.DATA80G3,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //DATA80P1 DD DSN=MFSYSMOD.DATA.DATA80P1,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //DATA80P2 DD DSN=MFSYSMOD.DATA.DATA80P2,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //DATA80P7 DD DSN=MFSYSMOD.DATA.DATA80P7,DISP=(MOD,DELETE,DELETE), // STORCLAS=MFI, // SPACE=(TRK,5), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=800,DSORG=PS) //* SummaryThis suite of programs and documentation will describe and demonstrate the dynamic file allocation function for the Micro Focus Studio and Server environments. This document may be used 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.
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. Downloads and LinksThis 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. Current Server or Internet AccessThe 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 the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets. 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. Internet Access RequiredThe 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. Glossary of TermsExplore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers. Contact or FeedbackThis document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
We appreciate hearing from you. Company OverviewSimoTime 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
|