EXEC CICS SPOOL
Submit JCL to INTRDR from CICS
  Table of Contents  v-16.01.01 - ccsrdr01.htm 
  Introduction
  The CICS Transaction (JRDR)
  The Batch Jobs
  JCL Member for Reference Sample
  CICS Program to INTRDR
  The COBOL Program
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This example uses a COBOL program running under CICS to submit a batch job (i.e. JCL) to the Internal Reader (or INTRDR). The program uses command level CICS statements (EXEC CICS SPOOL) to access the internal reader. The program will run on an IBM Mainframe System with CICS or a Microsoft Windows System with Micro Focus Server and the Mainframe Sub-System option.


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-2017
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section The CICS Transaction (JRDR)

Start a 3270 Session and execute the "JRDR" Transaction. The following is an overview of the Batch Job submission process.

             
JRDR
CICS Transaction
The CICS transaction to submit a job to batch
   
CCSJCLC1
This is a COBOL CICS Prpgram, refer to Note-1
   
EXEC CICS
SPOOLOPEN
Open access to the SPOOL functions
   
Working Storage
 
 
EXEC CICS
SPOOLWRITE
 
 
INTRDR
JES Batch
Write JCL Statements to Internal Reader
   
EXEC CICS
SPOOLCLOSE
Close access to the SPOOL functions
   
EXEC CICS
RETURN
Normal Return to CICS sub-system
 
Note-1: This step will take JCL Statements from a table in Working Storage and submit the statements to the JES Internal Reader.
Overview of the Process for submitting a Job to the JES Internal Reader using EXEC CICS SPOOL

Table of Contents Previous Section Next Section The Batch Jobs

This example includes two batch jobs. The first job (CCSRDRJ8.jcl) is provided as a reference point. It is a standard JCL member that is submitted and executed in the traditional batch environment. The second batch job is submitted to the internal reader (INTRDR) from within a COBOL program running in a CICS environment. A JCL member does not exist. The JCL statements are created from data defined in the WORKING-STORAGE section of the COBOL program and written to the INTRDR. When all the JCL statements have been written to the INTRDR the job is executed.

Table of Contents Previous Section Next Section JCL Member for Reference Sample

This JCL Member (CCSRDRJ8.jcl) is provided as a sample job that is submitted and executed in the JES Batch environment.

//CCSRDRJ8 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
//* *******************************************************************
//*       CCSRDRJ8.JCL - a JCL Member for Batch Job Processing        *
//*       This JCL Member is provided by SimoTime Technologies        *
//*           (C) Copyright 1987-2017 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 (QSAMDELT) will delete any previously created
//* file. The second job step (QCRTDIN1) will create a new file.
//*
//* This set of programs will run on a mainframe under MVS or on a
//* Personal Computer with Windows and Micro Focus Mainframe Express.
//*
//* *******************************************************************
//* Step 1 of 2, Delete any previously created file...
//*
//QSAMDELT EXEC PGM=IEFBR14
//SYSUT2   DD  DSN=SIMOTIME.CICSNOK.RDRTEST1,
//             DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//*
//* *******************************************************************
//* Step 2 of 2, Create and populate a new QSAM file...
//*
//QCRTDIN1 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6
//SYSUT1   DD  *
CCSRDRC1 Job Submission
/*
//SYSUT2   DD  DSN=SIMOTIME.CICSNOK.RDRTEST1,
//             DISP=(NEW,CATLG,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
//

Table of Contents Previous Section Next Section CICS Program to INTRDR

The following JCL Member (CCSRDRJ9.jcl) does not exist as a JCL Member. Each JCL statement is a data item in the WORKING-STORAGE section of the COBOL program (CCSJCLC1.cbl. The following is a list of the JCL statements created and submitted by the COBOL program running in the CICS environment.

   1 //CCSRDRJ9 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1
   2 //QSAMDELT EXEC PGM=IEFBR14
   3 //SYSUT2   DD  DSN=SIMOTIME.CICSAOK.RDRTEST1,
   4 //             DISP=(MOD,DELETE,DELETE),
   5 //             STORCLAS=MFI,
   6 //             SPACE=(TRK,5),
   7 //             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
   8 //*
   9 //QCRTDIN1 EXEC PGM=IEBGENER
  10 //SYSPRINT DD  SYSOUT=*
  11 //SYSIN    DD  DUMMY
  12 //* :....1....:....2....:....3....:....4....:....5....:....6
  13 //SYSUT1   DD  *
  14 CCSRDRC1 2010/12/06 12:03:00:09 Job Submitted from CICS
  15 /*
  16 //SYSUT2   DD  DSN=SIMOTIME.CICSAOK.RDRTEST1,
  17 //             DISP=(NEW,CATLG,DELETE),
  18 //             STORCLAS=MFI,
  19 //             SPACE=(TRK,5),
  20 //             DCB=(RECFM=FB,LRECL=80,DSORG=PS)
  21 // 

Table of Contents Previous Section Next Section The COBOL Program

The COBOL program (CCSJCLC1.cbl) uses the EXEC CICS SPOOL capabilities to submit a batch job to the internal reader (INTRDR) from within a CICS Program. The following is an example of the source code.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.  CCSJCLC1.
       AUTHOR.      SIMOTIME TECHNOLOGIES.
      *****************************************************************
      * Copyright (C) 1987-2016 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
      * -----------
      * 1992/11/27 Simmons, Created program.
      * 1997/03/17 Simmons, Updated JCL being submitted.
      *
      *****************************************************************
      * DESCRIPTION
      * -----------
      * This program will submit a job to the internal reader (INTRDR)
      * using the EXEC CICS SPOOL commands.
      *****************************************************************
       ENVIRONMENT DIVISION.
      *---------------------------------------------------------------*
       CONFIGURATION SECTION.
       SOURCE-COMPUTER.     ES-MSS.
       OBJECT-COMPUTER.     ES-MSS.

      *****************************************************************
       DATA DIVISION.
      *---------------------------------------------------------------*
       WORKING-STORAGE SECTION.
       01  WS-PROGRAM-LOCATION         PIC X(04).

       01  WS-MSG-TEXT                 PIC X(60).
       01  WS-MSG-LEN                  PIC S9(04) COMP VALUE +60.

       01  WORK-DATE.
           05  WORK-DATE-CC    pic X(02).
           05  WORK-DATE-YY    pic 9(02).
           05  WORK-DATE-MM    pic X(02).
           05  WORK-DATE-DD    pic 9(02).
       01  WORK-TIME.
           05  WORK-TIME-HH    pic X(02).
           05  WORK-TIME-MM    pic X(02).
           05  WORK-TIME-SS    pic X(02).
           05  WORK-TIME-TT    pic X(02).

       01  EDIT-DATE.
           05  EDIT-DATE-CC    pic X(02).
           05  EDIT-DATE-YY    pic 9(02).
           05  filler          pic X       value '/'.
           05  EDIT-DATE-MM    pic X(02).
           05  filler          pic X       value '/'.
           05  EDIT-DATE-DD    pic 9(02).
       01  EDIT-TIME.
           05  EDIT-TIME-HH    pic X(02).
           05  filler          pic X       value ':'.
           05  EDIT-TIME-MM    pic X(02).
           05  filler          pic X       value ':'.
           05  EDIT-TIME-SS    pic X(02).
           05  filler          pic X       value ':'.
           05  EDIT-TIME-TT    pic X(02).

       01  WS-BEGIN-MSG                PIC X(40)   VALUE
           'CCSJCLC1 - TRANSACTION STARTED          '.
       01  WS-END-MSG                  PIC X(50)   VALUE
           'CCSJCLC1 - Submit JCL to INTRDR from CICS         '.
       01  WS-ERR-LOAD-PROGRAM         PIC X(50)   VALUE
           'CCSJCLC1 - TRAN FAILED - JCL to INTRDR FAILED     '.

       01  MEMBER-NAME         PIC X(8)    VALUE 'CSSJCLC1'.

       01  SPOOL-FIELDS.
           03  SPOOL-TOKEN     PIC X(8)  VALUE LOW-VALUES.
           03  SPOOL-NODE      PIC X(8)  VALUE 'SIMOCICS'.
           03  SPOOL-USERID    PIC X(8)  VALUE 'INTRDR  '.
           03  SPOOL-CLASS     PIC X     VALUE 'A'.

       01  CICS-RESP           PIC X(04).
       01  WS-RESP2            PIC X(04).
       01  CICS-80             PIC X(80).

       01  JOB-ONE.
           05  filler  pic X(60) value
       '//CCSRDRJ9 JOB SIMOTIME,CLASS=R,MSGCLASS=0,NOTIFY=CSIP1     '.
           05  filler  pic X(60) value
       '//QSAMDELT EXEC PGM=IEFBR14                                 '.
           05  filler  pic X(60) value
       '//SYSUT2   DD  DSN=SIMOTIME.CICSAOK.RDRTEST1,               '.
           05  filler  pic X(60) value
       '//             DISP=(MOD,DELETE,DELETE),                    '.
           05  filler  pic X(60) value
       '//             STORCLAS=MFI,                                '.
           05  filler  pic X(60) value
       '//             SPACE=(TRK,5),                               '.
           05  filler  pic X(60) value
       '//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)             '.
           05  filler  pic X(60) value
       '//*                                                         '.
           05  filler  pic X(60) value
       '//QCRTDIN1 EXEC PGM=IEBGENER                                '.
           05  filler  pic X(60) value
       '//SYSPRINT DD  SYSOUT=*                                     '.
           05  filler  pic X(60) value
       '//SYSIN    DD  DUMMY                                        '.
           05  filler  pic X(60) value
       '//* :....1....:....2....:....3....:....4....:....5....:....6'.
           05  filler  pic X(60) value
       '//SYSUT1   DD  *                                            '.
      *    05  filler  pic X(60) value
      *'CCSRDRC1 Job Submission from CICS...                        '.
           05  DATA-RECORD.
               10  filler  pic X(8)    value 'CCSRDRC1'.
               10  filler  pic X       value SPACE.
               10  D-DATE  pic X(10)   value SPACES.
               10  filler  pic X       value SPACE.
               10  D-TIME  pic X(11)   value SPACES.
               10  filler  pic X       value SPACE.
               10  filler  pic X(23)   value 'Job Submitted from CICS'.
               10  filler  pic X(5)    value SPACES.
           05  filler  pic X(60) value
       '/*                                                          '.
           05  filler  pic X(60) value
       '//SYSUT2   DD  DSN=SIMOTIME.CICSAOK.RDRTEST1,               '.
           05  filler  pic X(60) value
       '//             DISP=(NEW,CATLG,DELETE),                     '.
           05  filler  pic X(60) value
       '//             STORCLAS=MFI,                                '.
           05  filler  pic X(60) value
       '//             SPACE=(TRK,5),                               '.
           05  filler  pic X(60) value
       '//             DCB=(RECFM=FB,LRECL=80,DSORG=PS)             '.
           05  filler  pic X(60) value
       '//                                                          '.

       01  WX-1            pic 9(5)    value 0.

      *****************************************************************
       LINKAGE SECTION.
       01  DFHCOMMAREA                     PIC X(316).

       01  TBLECL-GROUP.
           05  filler          PIC X(300).

      *****************************************************************
       PROCEDURE DIVISION.
      *    Display console message - start processing
           move WS-BEGIN-MSG   to WS-MSG-TEXT.
           perform Z-SEND-MSG-TEXT.

      *    Submit JCL to INTRDR
           if  EIBRESP NOT = DFHRESP (NORMAL)
               move WS-ERR-LOAD-PROGRAM to WS-MSG-TEXT
               perform Z-SEND-MSG-TEXT
               go to Z-RETURN-TO-CICS.

               perform Z-GET-DATE-AND-TIME
               perform INTRDR-SPOOL-OPEN
               move EDIT-DATE to D-DATE
               move EDIT-TIME to D-TIME
               add 1 to ZERO giving WX-1
               perform 21 times
                   move JOB-ONE(WX-1:60) to CICS-80
                   perform INTRDR-SPOOL-WRITE
                   add 60 to WX-1
               end-perform
               perform INTRDR-SPOOL-CLOSE

           move WS-END-MSG to WS-MSG-TEXT.
           perform Z-SEND-MSG-TEXT.

           go to Z-RETURN-TO-CICS.

      *****************************************************************
       INTRDR-SPOOL-OPEN.
           EXEC CICS SPOOLOPEN OUTPUT
                     TOKEN  (SPOOL-TOKEN)
                     USERID (SPOOL-USERID)
                     NODE   (SPOOL-NODE)
                     CLASS  (SPOOL-CLASS)
                     PUNCH
                     RESP   (CICS-RESP)
                     RESP2  (WS-RESP2)
           END-EXEC
           exit.

      *****************************************************************
       INTRDR-SPOOL-WRITE.
           EXEC CICS SPOOLWRITE
                     TOKEN (SPOOL-TOKEN)
                     FROM  (CICS-80)
                     RESP  (CICS-RESP)
                     RESP2 (WS-RESP2)
           END-EXEC.
           exit.

      *****************************************************************
       INTRDR-SPOOL-CLOSE.
           EXEC CICS SPOOLCLOSE
                     TOKEN (SPOOL-TOKEN)
                     RESP  (CICS-RESP)
                     RESP2 (WS-RESP2)
           END-EXEC
           exit.

      *****************************************************************
       Z-SEND-MSG-TEXT.
      *    Send console message
           EXEC CICS SEND TEXT
                     FROM ( WS-MSG-TEXT )
                     LENGTH( WS-MSG-LEN )
                     ERASE
                     FREEKB
                     END-EXEC.
           exit.

      *****************************************************************
       Z-RETURN-TO-CICS.
      *    Program return to cics
           EXEC CICS RETURN END-EXEC.

      *****************************************************************
       Z-GET-DATE-AND-TIME.
           accept WORK-DATE from DATE YYYYMMDD
           accept WORK-TIME from TIME

           move 'ccyy/mm/dd' to EDIT-DATE
           move WORK-DATE-CC to EDIT-DATE-CC
           move WORK-DATE-YY to EDIT-DATE-YY
           move WORK-DATE-MM to EDIT-DATE-MM
           move WORK-DATE-DD to EDIT-DATE-DD

           move 'hh:mm:ss:dd' to EDIT-TIME
           move WORK-TIME-HH  to EDIT-TIME-HH
           move WORK-TIME-MM  to EDIT-TIME-MM
           move WORK-TIME-SS  to EDIT-TIME-SS
           move WORK-TIME-TT  to EDIT-TIME-TT

           exit.

Table of Contents Previous Section Next Section Summary

This example uses a COBOL program running under CICS to submit a batch job (i.e. JCL) to the Internal Reader (or INTRDR). 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 document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The 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 send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

Table of Contents Previous Section Next Section Software Agreement and Disclaimer

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

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

Table of Contents Previous Section Next Section Downloads and Links

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

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

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

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

Link to Internet   Link to Server   Explore How to Submit a Job to INTRDR using COBOL. This suite of programs and documentation will describe and demonstrate how to use a COBOL program in a job step to submit a secondary job to the Internal Reader (INTRDR).

Link to Internet   Link to Server   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).

Link to Internet   Link to Server   Explore the CICS Connection for more examples of mainframe CICS coding techniques and sample code.

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

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

This suite of programs and documentation is available 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 and services available from Micro Focus. This link requires an Internet Connection.

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions or need assistance with converting non-relational data structures simply give us a call at 415 883-6565 or check the web site at http://www.simotime.com


Return-to-Top
Submit JCL to INTRDR from CICS using EXEC CICS SPOOL
Copyright © 1987-2017
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com