Internal Reader Submitting Jobs using COBOL |
The SimoTime Home Page |
This suite of programs will describe how to submit a second job to the internal reader (or INTRDR) from within the currently running job that is executing a COBOL program. For this example the second job (or submitted job) simply executes IEFBR14 with a return to the caller.
The source code, data sets and documentation are provided in a single zipped file called CBLSUB01.ZIP. This zipped file may be downloaded from the SimoTime Web site. In the Windows environment the file names have file extensions. If the JCL member is uploaded to a ZOS Mainframe from the Windows and Micro Focus environment the file extension is dropped.
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 example contains two (2) JCL members. The first JCL member executes a COBOL program that will submit a job to the internal reader.
The second JCL member uses IEFBR14 to return to caller and is submitted by the COBOL program being executed by the first job.
The following mainframe JCL (CBLSUBJ1.jcl) executes a COBOL program that will submit a second job to the Internal Reader (INTRDR). The COBOL program is coded to read an 80-byte record sequential file (JCLINPUT) and write to an 80-byte record sequential file (SUBTORDR). The COBOL program is a simply file copy.
The DD statements map the COBOL file names to the actual physical locations. The file to be copied is JCLINPUT and the output file is SUBTORDR. The JCLINPUT file is a member of a partitioned data set (PDS) that contains JCL. The SUBTORDR file is mapped to SYSOUT=(,INTRDR). The JCLINPUT is copied to (or submitted to) the internal reader.
//CBLSUBJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBLSUBJ1.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 - Submit JCL to the Internal Reader. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The job will read an 80-byte file that contains JCL and write //* to the JES Internal Reader (INTRDR). //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express. //* //* ************ //* * CBLSUBJ1 * //* ********jcl* //* * //* * //* ************ ************ ************ //* * JCLINPUT *-----* CBLSUBC1 *-----* SUBTORDR * //* ********pds* ********cbl* *****intrdr* //* * //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 1, Execute the COBOL Program... //* //SUBMITS1 EXEC PGM=CBLSUBC1 //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //JCLINPUT DD DSN=SIMOTIME.PDS.JCL(UVBR00J1),DISP=SHR //SUBTORDR DD SYSOUT=(,INTRDR) //SYSOUT DD SYSOUT=* //
The following COBOL program (CBLSUBC1.cbl) will submit a job to the Internal Reader. The COBOL program is coded to read an 80-byte record sequential file (JCLINPUT) and write to an 80-byte record sequential file (SUBTORDR). The COBOL program is a simply file copy. The DD statements in the JCL map the COBOL file names to the actual physical locations. The file to be copied is JCLINPUT and the output file is SUBTORDR. The JCLINPUT file is member of a partitioned data set (PDS) that contains JCL. The SUBTORDR file is mapped to SYSOUT=(,INTRDR) and this copies the JCLINPUT to the internal reader (or submits the job to the internal reader).
IDENTIFICATION DIVISION. PROGRAM-ID. CBLSUBC1. 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:11:44 * * * * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * PRIMARY JCLINPUT SEQUENTIAL FIXED 00080 * * * * SECONDARY SUBTORDR SEQUENTIAL FIXED 00080 * * * * * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT JCLINPUT-FILE ASSIGN TO JCLINPUT ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS JCLINPUT-STATUS. SELECT SUBTORDR-FILE ASSIGN TO SUBTORDR ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SUBTORDR-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD JCLINPUT-FILE DATA RECORD IS JCLINPUT-REC . 01 JCLINPUT-REC. 05 JCLINPUT-DATA-01 PIC X(00080). FD SUBTORDR-FILE DATA RECORD IS SUBTORDR-REC . 01 SUBTORDR-REC. 05 SUBTORDR-DATA-01 PIC X(00080). ***************************************************************** * 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 '* CBLSUBC1 '. 05 T2 pic X(34) value 'A COBOL Program, Submit to INTRDR '. 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 '* CBLSUBC1 '. 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 JCLINPUT-STATUS. 05 JCLINPUT-STATUS-L pic X. 05 JCLINPUT-STATUS-R pic X. 01 JCLINPUT-EOF pic X value 'N'. 01 JCLINPUT-OPEN-FLAG pic X value 'C'. 01 SUBTORDR-STATUS. 05 SUBTORDR-STATUS-L pic X. 05 SUBTORDR-STATUS-R pic X. 01 SUBTORDR-EOF pic X value 'N'. 01 SUBTORDR-OPEN-FLAG pic X value 'C'. 01 JCLINPUT-LRECL pic 9(5) value 00080. 01 SUBTORDR-LRECL pic 9(5) value 00080. 01 JCLINPUT-LRECL-MAX pic 9(5) value 00080. 01 SUBTORDR-LRECL-MAX pic 9(5) value 00080. ***************************************************************** * 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 '* CBLSUBC1 '. 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 'CBLSUBC1'. 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 'A COBOL Program, Submit to INTRDR '. 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 JCLINPUT-TOTAL. 05 JCLINPUT-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for JCLINPUT'. 01 SUBTORDR-TOTAL. 05 SUBTORDR-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SUBTORDR'. ***************************************************************** 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 JCLINPUT-OPEN perform SUBTORDR-OPEN * USRSOJ Processing not specified... perform until JCLINPUT-STATUS not = '00' perform JCLINPUT-READ if JCLINPUT-STATUS = '00' add 1 to JCLINPUT-RDR perform BUILD-OUTPUT-RECORD if WRITE-FLAG = 'Y' perform SUBTORDR-WRITE if SUBTORDR-STATUS = '00' add 1 to SUBTORDR-ADD end-if end-if end-if end-perform * USREOJ Processing not specified... move JCLINPUT-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-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 SUBTORDR-CLOSE perform JCLINPUT-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. * TransCOPY... move JCLINPUT-REC(00001:00080) to SUBTORDR-REC(00001:00080) exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** JCLINPUT-CLOSE. add 8 to ZERO giving APPL-RESULT. close JCLINPUT-FILE if JCLINPUT-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 JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* JCLINPUT-READ. read JCLINPUT-FILE if JCLINPUT-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if JCLINPUT-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 JCLINPUT-EOF else move 'READ Failure with JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* JCLINPUT-OPEN. add 8 to ZERO giving APPL-RESULT. open input JCLINPUT-FILE if JCLINPUT-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to JCLINPUT-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** SUBTORDR-WRITE. if SUBTORDR-OPEN-FLAG = 'C' perform SUBTORDR-OPEN end-if write SUBTORDR-REC if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SUBTORDR-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 SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SUBTORDR-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT SUBTORDR-FILE if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SUBTORDR-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SUBTORDR-CLOSE. add 8 to ZERO giving APPL-RESULT. close SUBTORDR-FILE if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to SUBTORDR-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-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:11:46 * *****************************************************************
This example contains two (2) JCL members. The first JCL member executes a COBOL program that will submit a job to the internal reader. The JCL (or source code for the JOB script) will be modified prior to submission.
The second JCL member uses IEFBR14 to return to caller and is submitted by the COBOL program being executed by the first job.
The following mainframe JCL (CBLSUBJ2.jcl) executes a COBOL program that will submit a job to the Internal Reader. The COBOL program is coded to read an 80-byte record sequential file (JCLINPUT) and write to an 80-byte record sequential file (SUBTORDR). The COBOL program is a simply file copy.
The DD statements map the COBOL file names to the actual physical locations. The file to be copied is JCLINPUT and the output file is SUBTORDR. The JCLINPUT file is member of a partitioned data set (PDS) that contains JCL. The SUBTORDR file is mapped to SYSOUT=(*,INTRDR). The JCLINPUT is copied to the internal reader (or submits the job to the internal reader).
//CBLSUBJ2 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBLSUBJ2.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 - Submit Modified JCL to the Internal Reader. //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* The job will read an 80-byte file that contains JCL and write //* to the JES Internal Reader (INTRDR). //* //* This job will modify the JCL to be submitted based on the //* information passed from the PARM= statement of the primary job. //* //* This set of programs will run on a mainframe under MVS or on a //* Personal Computer with Windows and Micro Focus Mainframe Express. //* //* ************ //* * CBLSUBJ2 * //* ********jcl* //* * //* * //* ************ ************ ************ //* * JCLINPUT *-----* CBLSUBC2 *-----* SUBTORDR * //* ********pds* ********cbl* *****intrdr* //* * //* * //* ************ //* * EOJ * //* ************ //* //* ******************************************************************* //* Step 1 of 2, Execute the COBOL Program... //* //SUBMITS1 EXEC PGM=CBLSUBC2,PARM='CHANGE CLASS=1 TO CLASS=R' //STEPLIB DD DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR //JCLINPUT DD DSN=SIMOTIME.PDS.JCL(UVBR00J1),DISP=SHR //SUBTORDR DD SYSOUT=(*,INTRDR) //SYSOUT DD SYSOUT=* //* ******************************************************************* //* Step 1 of 2, Wait thirty (30) seconds... //* //WAIT0030 EXEC PGM=MFWAIT4Z,PARM='00:00:30' //SYSOUT DD SYSOUT=* //
The following COBOL program (CBLSUBC2.cbl) will submit a job to the Internal Reader. The COBOL program is coded to read an 80-byte record sequential file (JCLINPUT) and write to an 80-byte record sequential file (SUBTORDR). The COBOL program is a simply file copy. The DD statements in the JCL map the COBOL file names to the actual physical locations. The file to be copied is JCLINPUT and the output file is SUBTORDR. The JCLINPUT file is member of a partitioned data set (PDS) that contains JCL. The SUBTORDR file is mapped to SYSOUT=(*,INTRDR) and this copies the JCLINPUT to the internal reader (or submits the job to the internal reader).
The following program will scan the JCL records looking for the CLASS= text string based on the PARM= data passed from JCL. The CLASS will be changed according to the information in the PARM= parameter.
IDENTIFICATION DIVISION. PROGRAM-ID. CBLSUBC2. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * Copyright (C) 1987-2019 SimoTime Technologies. * * * * All rights reserved. Unpublished, all rights reserved under * * copyright law and international treaty. Use of a copyright * * notice is precautionary only and does not imply publication * * or disclosure. * * * * Permission to use, copy, modify and distribute this software * * for any non-commercial purpose and without fee is hereby * * granted, 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. * * * * Permission to use, copy, modify and distribute this software * * for any commercial purpose requires a fee to be paid to * * SimoTime Technologies. Once the fee is received by SimoTime * * the latest version of the software 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 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 * * * * SimoTime Technologies * * 15 Carnoustie Drive * * Novato, CA 94949-5849 * * 415.883.6565 * * * * RESTRICTED RIGHTS LEGEND * * Use, duplication, or disclosure by the Government is subject * * to restrictions as set forth in subparagraph (c)(1)(ii) of * * the Rights in Technical Data and Computer Software clause at * * DFARS 52.227-7013 or subparagraphs (c)(1) and (2) of * * Commercial Computer Software - Restricted Rights at 48 * * CFR 52.227-19, as applicable. Contact SimoTime Technologies, * * 15 Carnoustie Drive, Novato, CA 94949-5849. * * * ***************************************************************** * This program is provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * * * ***************************************************************** * MAINTENANCE * ----------- * 1994/02/27 Simmons, Created program. * ***************************************************************** * Source Member: CBLSUBC1.CBL * Copy Files: none... * Calls to: none... ***************************************************************** * Record Record Key * * Function Name Organization Format Max-Min Pos-Len * * INPUT JCLINPUT SEQUENTIAL FIXED 00080 * * OUTPUT SUBTORDR SEQUENTIAL FIXED 00080 * ***************************************************************** ENVIRONMENT DIVISION. INPUT-OUTPUT SECTION. FILE-CONTROL. SELECT JCLINPUT-FILE ASSIGN TO JCLINPUT ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS JCLINPUT-STATUS. SELECT SUBTORDR-FILE ASSIGN TO SUBTORDR ORGANIZATION IS SEQUENTIAL ACCESS MODE IS SEQUENTIAL FILE STATUS IS SUBTORDR-STATUS. ***************************************************************** DATA DIVISION. FILE SECTION. FD JCLINPUT-FILE DATA RECORD IS JCLINPUT-REC . 01 JCLINPUT-REC. 05 JCLINPUT-DATA-01 PIC X(00080). FD SUBTORDR-FILE DATA RECORD IS SUBTORDR-REC . 01 SUBTORDR-REC. 05 SUBTORDR-DATA-01 PIC X(00080). ***************************************************************** WORKING-STORAGE SECTION. 01 SIM-TITLE. 05 T1 pic X(11) value '* CBLSUBC2 '. 05 T2 pic X(34) value 'A COBOL Program, Submit to INTRDR '. 05 T3 pic X(10) value ' v08.06.05'. 05 T4 pic X(24) value ' http://www.simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* CBLSUBC2 '. 05 C2 pic X(20) value 'Copyright 1987-2019 '. 05 C3 pic X(28) value ' SimoTime Technologies '. 05 C4 pic X(20) value ' All Rights Reserved'. 01 JCLINPUT-STATUS. 05 JCLINPUT-STATUS-L pic X. 05 JCLINPUT-STATUS-R pic X. 01 JCLINPUT-EOF pic X value 'N'. 01 JCLINPUT-OPEN-FLAG pic X value 'C'. 01 SUBTORDR-STATUS. 05 SUBTORDR-STATUS-L pic X. 05 SUBTORDR-STATUS-R pic X. 01 SUBTORDR-EOF pic X value 'N'. 01 SUBTORDR-OPEN-FLAG pic X value 'C'. 01 JCLINPUT-LRECL pic 9(5) value 00080. 01 SUBTORDR-LRECL pic 9(5) value 00080. ***************************************************************** * 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(11) value '* CBLSUBC2 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(109) value SPACES. 10 MESSAGE-TEXT-2 pic X(136) value SPACES. ***************************************************************** 01 PROGRAM-NAME pic X(8) value 'CBLSUBC1'. 01 APPL-RESULT pic S9(9) comp. 88 APPL-AOK value 0. 88 APPL-EOF value 16. 01 CHANGE-JOB-CLASS pic X value 'Y'. 01 CLASS-SEARCH pic X(7) value SPACES. 01 CLASS-MODIFY pic X(7) value SPACES. 01 JCLINPUT-TOTAL. 05 JCLINPUT-RDR pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for JCLINPUT'. 01 SUBTORDR-TOTAL. 05 SUBTORDR-ADD pic 9(9) value 0. 05 filler pic X(3) value ' - '. 05 filler pic X(23) value 'Line count for SUBTORDR'. 01 MESSAGE-TEXT-01. 05 filler pic X(20) value 'Parameter length is '. 05 JCL-PARM-LENGTH pic 9(5) value 0. ***************************************************************** LINKAGE SECTION. 01 PARM-BUFFER. 05 PARM-LENGTH pic S9(4) comp. 05 PARM-DATA pic X(256). ***************************************************************** PROCEDURE DIVISION using PARM-BUFFER. perform Z-POST-COPYRIGHT perform EXTERNAL-PARAMETERS perform JCLINPUT-OPEN perform SUBTORDR-OPEN perform until JCLINPUT-STATUS not = '00' perform JCLINPUT-READ if JCLINPUT-STATUS = '00' add 1 to JCLINPUT-RDR perform BUILD-OUTPUT-RECORD * Display JCL Statement to SYSOUT move SUBTORDR-REC to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT * Submit JCL Statement to INTRDR perform SUBTORDR-WRITE if SUBTORDR-STATUS = '00' add 1 to SUBTORDR-ADD end-if end-if end-perform move JCLINPUT-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-TOTAL to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if APPL-EOF move 'is Complete...' to MESSAGE-TEXT else move 'is ABENDING...' to MESSAGE-TEXT end-if perform Z-DISPLAY-MESSAGE-TEXT perform SUBTORDR-CLOSE perform JCLINPUT-CLOSE GOBACK. ***************************************************************** BUILD-OUTPUT-RECORD. *> TransCOPY... move JCLINPUT-REC to SUBTORDR-REC if CHANGE-JOB-CLASS = 'Y' and SUBTORDR-REC(1:3) not = '//*' inspect SUBTORDR-REC replacing first 'CLASS=1' by 'CLASS=R' if JCLINPUT-REC not = SUBTORDR-REC move 'N' to CHANGE-JOB-CLASS end-if end-if exit. ***************************************************************** EXTERNAL-PARAMETERS. add PARM-LENGTH to ZERO giving JCL-PARM-LENGTH move MESSAGE-TEXT-01 to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT if PARM-LENGTH > 0 move PARM-DATA(1:PARM-LENGTH) to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT end-if * ....:....1....:....2....: * PARM='CHANGE CLASS=1 TO CLASS=R if PARM-LENGTH = 25 and PARM-DATA(1:7) = 'CHANGE ' and PARM-DATA(15:4) = ' TO ' move PARM-DATA(8:7) to CLASS-SEARCH move PARM-DATA(19:7) to CLASS-MODIFY move 'External PARM accepted...' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT else move 'N' to CHANGE-JOB-CLASS move 'External PARM is invalid, parameter ignored!' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT end-if exit. ***************************************************************** * I/O Routines for the INPUT File... * ***************************************************************** JCLINPUT-CLOSE. add 8 to ZERO giving APPL-RESULT. close JCLINPUT-FILE if JCLINPUT-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 JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* JCLINPUT-READ. read JCLINPUT-FILE if JCLINPUT-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if JCLINPUT-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 JCLINPUT-EOF else move 'READ Failure with JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if end-if exit. *---------------------------------------------------------------* JCLINPUT-OPEN. add 8 to ZERO giving APPL-RESULT. open input JCLINPUT-FILE if JCLINPUT-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to JCLINPUT-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with JCLINPUT' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move JCLINPUT-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. ***************************************************************** * I/O Routines for the OUTPUT File... * ***************************************************************** SUBTORDR-WRITE. if SUBTORDR-OPEN-FLAG = 'C' perform SUBTORDR-OPEN end-if write SUBTORDR-REC if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT else if SUBTORDR-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 SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SUBTORDR-OPEN. add 8 to ZERO giving APPL-RESULT. open OUTPUT SUBTORDR-FILE if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'O' to SUBTORDR-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'OPEN Failure with SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-STATUS to IO-STATUS perform Z-DISPLAY-IO-STATUS perform Z-ABEND-PROGRAM end-if exit. *---------------------------------------------------------------* SUBTORDR-CLOSE. add 8 to ZERO giving APPL-RESULT. close SUBTORDR-FILE if SUBTORDR-STATUS = '00' subtract APPL-RESULT from APPL-RESULT move 'C' to SUBTORDR-OPEN-FLAG else add 12 to ZERO giving APPL-RESULT end-if if APPL-AOK CONTINUE else move 'CLOSE Failure with SUBTORDR' to MESSAGE-TEXT perform Z-DISPLAY-MESSAGE-TEXT move SUBTORDR-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. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. if MESSAGE-TEXT-2 = SPACES display MESSAGE-BUFFER(1:120) else display MESSAGE-BUFFER end-if 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: 2008-04-28 Generation Time: 18:02:52:62 * *****************************************************************
This section described the members that are used by other applications or more than one (1) of the preceding examples.
The following mainframe JCL (UVBR00J1.jcl) is used to set the Condition Code to ZERO and return to caller.
//UVBR00J1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1,USER=SIMOTIME //* ******************************************************************* //* UVBR00J1.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 - Set Condition-Code to ZERO and return to caller //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* ******************************************************************* //* Step 1 of 1, Execute the program... //* //NULLSTEP EXEC PGM=IEFBR14 //*
This suite of programs will describe how to submit a second job to the internal reader (or INTRDR) from within the currently running job that is executing a COBOL program. 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.
Explore How to Submit a Job to INTRDR using IEBGENER. This suite of programs and documentation will describe and demonstrate how to use IEBGENER in a job step to submit a secondary job to the Internal Reader (INTRDR).
Explore How to Submit a Batch Job to INTRDR from CICS using the EXEC CICS SPOOL functions.
Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.
Explore the JCL Connection for more examples of JCL functionality with programming techniques and sample code.
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 for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.
Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.
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 |
Internal Reader - Submitting Jobs using COBOL |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |