JOB and DD Query
COBOL Access to JCL Specifications
  Table of Contents  v-24.01.01 - jobqry01.htm 
  Introduction
  Batch Job Objectives
  Batch Job Results
  Batch Job Requirements
  Batch Job Overview
  Execute the Batch Job
  Technical Details
  The JCL Member
  The COBOL Source Members
  The Sample COBOL Program
  The COBOL Copy File
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This sample program demonstrates how to access JCL specifications from a COBOL program using the SimoTime Job Query program. Information provided with the JOB and DD statements may be obtained by a simple call. For example, the Job Name and Job Number will be provided to the COBOL program.

This suite of programs requires a Windows System with Micro Focus Enterprise Server and the SimoTime Library.


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

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

Table of Contents Previous Section Next Section Batch Job Objectives

This example illustrates the following functions.

1. From within a COBOL program demonstrate how to access Job Information provided by the JOB Statement in the JCL.
2. From within a COBOL program demonstrate how to access File Information provided by a DD Statement in the JCL.
3. Demonstrate how to write the JOB and DD information to a SYSOUT device.

 

The preceding is a list of the Batch Job Objectives.

Table of Contents Previous Section Next Section Batch Job Results

The following shows an example of the results produced by this sample job.

* JOBQRYC1 Access to JOB and DD Information   v08.06.05 http://www.simotime.com
* JOBQRYC1 Copyright 1987-2016    SimoTime Technologies     All Rights Reserved
* JOBQRYC1 Enter, ACTION-GET-JOB-INFORMATION
* JOBQRYC1 MVS-JOBNAME ...........  JOBQRYJ1
* JOBQRYC1 MVS-JOBID .............  19428
* JOBQRYC1 MVS-JOBSTEP ...........  JOBQRYS1
* JOBQRYC1 MVS-PROCSTEP ..........
* JOBQRYC1 MVS-JOB-USERID ........  JESUSER
* JOBQRYC1 MVS-JOB-CLASS .........  1
* JOBQRYC1 MVS-JOB-MSGCLASS ......  0
* JOBQRYC1 MVS-LOAD-MODULE .......  JOBQRYC1
* JOBQRYC1 MVS-JOB-ACCOUNT .......  SIMOTIME
* JOBQRYC1 MVS-JOB-PROGRAMMER ....  GET JOB INFORMATION
* JOBQRYC1 MVS-JOB-START-DATE ....  20160610
* JOBQRYC1 MVS-JOB-START-TIME ....  01110812
* JOBQRYC1 MVS-STEP-START-DATE ...  20160610
* JOBQRYC1 MVS-STEP-START-TIME ...  01110931
* JOBQRYC1 Leave, ACTION-GET-JOB-INFORMATION
* JOBQRYC1 Enter, ACTION-GET-FILE-INFO-01
* STJQUERY ID-20-> DD=JOBQRYD1 DSORG=PS   DSN=SIMOTIME.DATA.JOBQRYD1
* JOBQRYC1 MVS-DDNAME ............  JOBQRYD1
* JOBQRYC1 MVS-DSNAME ............  SIMOTIME.DATA.JOBQRYD1
* JOBQRYC1 MVS-DSORG .............  PS
* JOBQRYC1 MVS-RECFM .............  F
* JOBQRYC1 MVS-DISP-INIT .........  SHR
* JOBQRYC1 MVS-DISP-NORM .........
* JOBQRYC1 MVS-DISP-COND .........
* JOBQRYC1 MVS-LRECL-JCL .........  000080
* JOBQRYC1 MVS-LRECL-MIN .........  000080
* JOBQRYC1 MVS-LRECL-MAX .........  000080
* JOBQRYC1 MVS-BLKSIZE ...........  000000
* JOBQRYC1 MVS-KEYOFF ............  000000
* JOBQRYC1 MVS-KEYLEN ............  000
* JOBQRYC1 Leave, ACTION-GET-FILE-INFO-01
* JOBQRYC1 Thank you for using this program provided from SimoTime Technologies
* JOBQRYC1 Please send all inquires or suggestions to the helpdesk@simotime.com

Note: the preceding is an example of the data structure that is passed to the COBOL program. The MVS-JOBID is the Job Number.

Table of Contents Previous Section Next Section Batch Job Requirements

This suite of samples programs will run on the following platforms.

1. Requires Microsoft Windows/7 (or later) or Windows/Server.
2. Requires Micro Focus Enterprise Server with a configuration for Mainframe Sub-system Support.
3. Requires the SimoTime Library to be installed. The call to STJQUERY is a SimoTime Job Query program that is included in the Library.

 

The preceding is a list of the Batch Job Requirements for the Operating System, Sub-systems and Utility Programs.

Table of Contents Previous Section Next Section Batch Job Overview

The following diagram shows the logic flow for a batch job that describes and demonstrates how to call the SimoTime Job Query program to access information provided by the currently running Job and Job Step.

             
JOBQRYJ1
jcl
Start the process to access Job Information
   
IEFBR14
JOBSETUP
 
 
JOBQRYD1
rseq
Delete previously created files.
   
SYSUT1
instream
 
 
IEBGENER
MKRSEQ80
 
 
SYSUT2
rseq
Create the 1st Test File (JOBQRYD1)
   
JOBQRYC1
JOBQRYS1
 
 
SYSOUT
via DISPLAY
Query JCL Statements, write to SYSOUT Device
   
call
 
 
STJQUERY
Routine to call Micro Focus for JOB Information
   
EOJ
End-Of-Job
 
Create Test Files and Query JOB and DD Statements from COBOL

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section Execute the Batch Job

This Job has been created to run on a Windows System with Micro Focus Enterprise Server (ES). This Job (or JCL Member) may be submitted for execution to a Micro Focus Enterprise Server Instance (SI) that has been configured with the Mainframe Sub-System Option and has the JES function enabled.

The job may be submitted from within Micro Focus ES Administration (a Browser-based Interface) or from a Windows Command Line using the CASSUB Utility program provided by Micro Focus. The following shows the format for the Micro Focus CASSUB command.

C:\SIMOSAM1\DEVL\JCL> cassub -jmembername -rserverinstancename

The following shows the format for the CASSUB command that we used in a SimoTime System environment.

C:\SIMOSAM1\DEVL\JCL> cassub -jJOBQRYJ1.JCL -rSIMOBATA

Table of Contents Previous Section Next Section Technical Details

This section provides additional technical details about the modules that are included in the batch job example.

Table of Contents Previous Section Next Section The JCL Member

The following is a JCL member(JOBQRYJ1.jcl) used to run the COBOL program.

//JOBQRYJ1 JOB SIMOTIME,'GET JOB INFORMATION',CLASS=1,MSGCLASS=0,
//             NOTIFY=CSIP1
//* *******************************************************************
//*       JOBQRYJ1.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   - COBOL call to get JOB Information
//* Author - SimoTime Technologies
//* Date   - January 01, 1999
//*
//* This set of programs illustrate the use a COBOL program to do
//* a call to a Utility Program that provides JOB information.
//*
//*
//*   ************
//*   * JOBQRYJ1 *
//*   *jcl********
//*        *
//*        *
//*   ************     ************
//*   * JOBQRYC1 *-----*  SYSOUT  *
//*   *cbl********     ************
//*        *  *
//*        *  *        ************
//*        *  *--CALL--* STJQUERY *
//*        *           *utl********
//*        *
//*   ************
//*   *   EOJ    *
//*   ************
//*
/*
//* *******************************************************************
//* Step 1 of 3, Delete previously created Test Files,
//*              use IEFBR14 with a DD Statement
//*
//JOBSETUP EXEC PGM=IEFBR14
//SYSOUT   DD  SYSOUT=*
//JOBQRYD1 DD  DSN=SIMOTIME.DATA.JOBQRYD1,DISP=(MOD,DELETE,DELETE),
//             STORCLAS=MFI,
//             SPACE=(TRK,5),
//             DCB=(RECFM=F,LRECL=80,DSORG=PS)
//*
//*********************************************************************
//* Step 2 of 3, Build a Record Sequential File with 80-byte records
//*
//MKRSEQ80 EXEC PGM=IEBGENER
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  DUMMY
//* :....1....:....2....:....3....:....4....:....5....:....6....:....7.
//SYSUT1   DD  *
000000000010
000000000020
/*
//SYSUT2   DD  DISP=(NEW,CATLG,CATLG),
//             UNIT=SYSDA,
//             SPACE=(TRK,(1,1)),
//             DCB=(RECFM=F,LRECL=80,DSORG=PS),
//             DSN=SIMOTIME.DATA.JOBQRYD1
//*
//*********************************************************************
//* Step 3 of 3, Query JOB Information from within a COBOL Program
//*
//JOBQRYS1 EXEC PGM=JOBQRYC1
//STEPLIB  DD  DSN=SIMOTIME.DEMO.LOADLIB1,DISP=SHR
//JOBQRYD1 DD  DSN=SIMOTIME.DATA.JOBQRYD1,DISP=SHR
//SYSOUT   DD  SYSOUT=*
//*

Table of Contents Previous Section Next Section The COBOL Source Members

This sample job uses the following COBOL source members to build the executable load member that accesses the JOB information. The Job information is obtained by calling the SimoTime Job Query program.

Table of Contents Previous Section Next Section The Sample COBOL Program

This program (JOBQRYC1.cbl) uses a standard COBOL call to communicate with the SimoTime JOB Query program that returns the JOB and/or DD information to the calling program.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    JOBQRYC1.
       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       *
      *****************************************************************
      *
      *****************************************************************
      * Source Member: JOBQRYC1.CBL
      * Copy Files:    JQUERYB1.CPY
      * Calls to:      SIMOBITS
      *****************************************************************
      *
      * JOBQRYC1 - Call STJQUERY to get job information.
      *
      * CALLING PROTOCOL
      * ----------------
      * Use standard procedure to RUN or ANIMATE.
      *
      * DESCRIPTION
      * -----------
      * This program will call the SimoTime Job Query program to access
      * Job information that is provided in the JOB and DD statements.
      *
      *
      *          ************
      *          * JOBQRYJ1 *
      *          *jcl********
      *               *
      *               *
      *          ************     ************
      *          * JOBQRYC1 *-----*  SYSOUT  *
      *          *cbl********     ************
      *               *  *
      *               *  *        ************
      *               *  *--CALL--* STJQUERY *
      *               *           *utl********
      *               *
      *          ************
      *          *   EOJ    *
      *          ************
      *
      *****************************************************************
      *
      * MAINTENANCE
      * -----------
      * 1999/02/27 Simmons, Created program.
      * 1999/03/17 Simmons, Updated for call to STJPARTS.
      *
      *****************************************************************
      *
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *    ------------------------------------------------------------
       01  SIM-TITLE.
           05  T1 pic X(11) value '* JOBQRYC1 '.
           05  T2 pic X(34) value 'Access to JOB and DD Information  '.
           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 '* JOBQRYC1 '.
           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  SIM-THANKS-01.
           05  C1 pic X(11) value '* JOBQRYC1 '.
           05  C2 pic X(32) value 'Thank you for using this program'.
           05  C3 pic X(32) value ' provided from SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* JOBQRYC1 '.
           05  C2 pic X(32) value 'Please send all inquires or sugg'.
           05  C3 pic X(32) value 'estions to the helpdesk@simotime'.
           05  C4 pic X(04) value '.com'.

      *****************************************************************
      * Message Buffer used by the Z-POST-MESSAGE-TO-SYSOUT routine.  *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* JOBQRYC1 '.
           05  MESSAGE-TEXT        pic X(256)  value SPACES.
       01  MSG-LSB                 pic 9(3)    value 256.

       COPY JQUERYB1.

      *****************************************************************
       PROCEDURE DIVISION.

           perform Z-POST-COPYRIGHT

           perform ACTION-GET-JOB-INFORMATION

           perform ACTION-GET-FILE-INFO-01

           perform ACTION-GET-FILE-INFO-02

           perform Z-THANK-YOU

           move ZERO to RETURN-CODE

           GOBACK.

      *****************************************************************
       ACTION-GET-JOB-INFORMATION.
           move 'Enter, ACTION-GET-JOB-INFORMATION' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT

           move 'JOBINFO ' to MVS-REQUEST
           call 'STJQUERY' using MVS-JOBSTEP-INFO
           if  MVS-RESPOND = ZERO
               perform DISPLAY-JOB-INFORMATION
           else
               move 'ERROR, ACTION-GET-JOB-INFORMATION' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-SYSOUT
           end-if

           move 'Leave, ACTION-GET-JOB-INFORMATION' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       ACTION-GET-FILE-INFO-01.
           move 'Enter, ACTION-GET-FILE-INFO-01' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT

           move 'GETONEDD' to MVS-REQUEST
           move 'JOBQRYD1' to MVS-DDNAME
           call 'STJQUERY' using MVS-JOBSTEP-INFO
           if  MVS-RESPOND = ZERO
               perform DISPLAY-FILE-INFORMATION
           else
               move 'ERROR, ACTION-GET-FILE-INFO-01' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-SYSOUT
           end-if

           move 'Leave, ACTION-GET-FILE-INFO-01' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       ACTION-GET-FILE-INFO-02.
           move 'Enter, ACTION-GET-FILE-INFO-02' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT

           move 'DDLIST  ' to MVS-REQUEST
           move SPACES     to MVS-DDNAME
           call 'STJQUERY' using MVS-JOBSTEP-INFO
           if  MVS-RESPOND = ZERO
               move 'Given, ACTION-GET-FILE-INFO-02' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-SYSOUT
           else
               move 'ERROR, ACTION-GET-FILE-INFO-02' to MESSAGE-TEXT
               perform Z-POST-MESSAGE-TO-SYSOUT
           end-if

           move 'Leave, ACTION-GET-FILE-INFO-02' to MESSAGE-TEXT
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       DISPLAY-FILE-INFORMATION.
           move 'MVS-DDNAME ............ ' to MESSAGE-TEXT
           move  MVS-DDNAME                to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-DSNAME ............ ' to MESSAGE-TEXT
           move  MVS-DSNAME                to MESSAGE-TEXT(26:44)
           perform Z-POST-MESSAGE-TO-SYSOUT
           if  MVS-DSNAME-MBR not = SPACES
               move 'MVS-DSNAME-MBR ........ ' to MESSAGE-TEXT
               move  MVS-DSNAME-MBR            to MESSAGE-TEXT(26:8)
               perform Z-POST-MESSAGE-TO-SYSOUT
           end-if
           move 'MVS-DSORG ............. ' to MESSAGE-TEXT
           move  MVS-DSORG                 to MESSAGE-TEXT(26:4)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-RECFM ............. ' to MESSAGE-TEXT
           move  MVS-RECFM                 to MESSAGE-TEXT(26:4)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-DISP-INIT ......... ' to MESSAGE-TEXT
           move  MVS-DISP-INIT             to MESSAGE-TEXT(26:4)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-DISP-NORM ......... ' to MESSAGE-TEXT
           move  MVS-DISP-NORM             to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-DISP-COND ......... ' to MESSAGE-TEXT
           move  MVS-DISP-COND             to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-LRECL-JCL ......... ' to MESSAGE-TEXT
           move  MVS-LRECL-JCL             to MESSAGE-TEXT(26:6)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-LRECL-MIN ......... ' to MESSAGE-TEXT
           move  MVS-LRECL-MIN             to MESSAGE-TEXT(26:6)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-LRECL-MAX ......... ' to MESSAGE-TEXT
           move  MVS-LRECL-MAX             to MESSAGE-TEXT(26:6)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-BLKSIZE ........... ' to MESSAGE-TEXT
           move  MVS-BLKSIZE               to MESSAGE-TEXT(26:6)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-KEYOFF ............ ' to MESSAGE-TEXT
           move  MVS-KEYOFF                to MESSAGE-TEXT(26:6)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-KEYLEN ............ ' to MESSAGE-TEXT
           move  MVS-KEYLEN                to MESSAGE-TEXT(26:3)
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
       DISPLAY-JOB-INFORMATION.
           move 'MVS-JOBNAME ........... ' to MESSAGE-TEXT
           move  MVS-JOBNAME               to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOBID ............. ' to MESSAGE-TEXT
           move  MVS-JOBID                 to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOBSTEP ........... ' to MESSAGE-TEXT
           move  MVS-JOBSTEP               to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-PROCSTEP .......... ' to MESSAGE-TEXT
           move  MVS-PROCSTEP              to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-USERID ........ ' to MESSAGE-TEXT
           move  MVS-JOB-USERID            to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-CLASS ......... ' to MESSAGE-TEXT
           move  MVS-JOB-CLASS             to MESSAGE-TEXT(26:1)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-MSGCLASS ...... ' to MESSAGE-TEXT
           move  MVS-JOB-MSGCLASS          to MESSAGE-TEXT(26:1)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-LOAD-MODULE ....... ' to MESSAGE-TEXT
           move  MVS-LOAD-MODULE           to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-ACCOUNT ....... ' to MESSAGE-TEXT
           move  MVS-JOB-ACCOUNT           to MESSAGE-TEXT(26:144)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-PROGRAMMER .... ' to MESSAGE-TEXT
           move  MVS-JOB-PROGRAMMER        to MESSAGE-TEXT(26:20)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-START-DATE .... ' to MESSAGE-TEXT
           move  MVS-JOB-START-DATE        to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-JOB-START-TIME .... ' to MESSAGE-TEXT
           move  MVS-JOB-START-TIME        to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-STEP-START-DATE ... ' to MESSAGE-TEXT
           move  MVS-STEP-START-DATE       to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           move 'MVS-STEP-START-TIME ... ' to MESSAGE-TEXT
           move  MVS-STEP-START-TIME       to MESSAGE-TEXT(26:8)
           perform Z-POST-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * for this program.                                             *
      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.

      *****************************************************************
       Z-POST-MESSAGE-TO-SYSOUT.
           add 267 to ZERO giving MSG-LSB
           if  MESSAGE-BUFFER(122:146) = SPACES
               subtract 146 from MSG-LSB
               if  MESSAGE-BUFFER(80:41) = SPACES
                   subtract 41 from MSG-LSB
               end-if
           end-if
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           display SIM-THANKS-01
           display SIM-THANKS-02
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Technologies        *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

Table of Contents Previous Section Next Section The COBOL Copy File

This source member (JQUERYB1.cpy) is the COBOL copy file that defines the data structure (or Pass Area) that is used when calling the SimoTime Job Query program that returns the JOB and/or DD information to the calling program.

      *****************************************************************
      *              JQUERYB1.cpy is a COBOL Copy File                *
      *       Pass Area for a call to STJQUERY Utility Program.       *
      *         Copyright (C) 1987-2018 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      *                                                               *
      *    The CALL Interface is as follows...                        *
      *        move 'function' to MVS-REQUEST                         *
      *        call 'STJQUERY' using MVS-JOBSTEP-INFO                 *
      *                                                               *
      *    where 'function' is one of the following keywords.         *
      *    'JOBINFO ' - Display JOB information to SYSOUT             *
      *    'GETONEDD' - Get the DSN for a specific DD name.           *
      *    'DDLIST  ' - Display multiple DD statements to SYSOUT      *
      *    'DDFIRST ' - Get first DD Statement                        *
      *    'DDNEXT  ' - Get next DD Statement                         *
      *    'DYNALOC ' - Dynamic File Allocation                       *
      *    'DYNSOUT ' - Dynamic SYSOUT Allocation                     *
      *    'DEALLOC ' - Dynamic File De-Allocation (or Free)          *
      *                                                               *
      *    Note: if the text string within MVS-REQUEST is not eight   *
      *          bytes in length then the trailing bytes must be      *
      *          padded with space characters.                        *
      *****************************************************************
      *
       01  MVS-JOBSTEP-INFO.
           05  MVS-parm-version        pic  x(02)  value '02'.
               88  MVS-parm-vers-cur               value '02'.
               88  MVS-parm-vers-ansi              value  x'3032'.
               88  MVS-parm-vers-ebcdic            value  x'F0F2'.
           05  MVS-REQUEST             pic X(8).
           05  MVS-REQUEST-X1          pic X(8).
           05  MVS-REQUEST-X2          pic X(8).
           05  MVS-REQUEST-X3          pic X(8).
           05  MVS-REQUEST-X4          pic X(8).
           05  MVS-RESPOND             pic 9(8)    comp.
               88  MVS-RESP-OK                     value ZERO.
               88  MVS-RESP-incompatible-ver       value 101.
               88  MVS-RESP-unknown-function       value 102.
               88  MVS-RESP-mfbctlbp-error         value 103.
               88  MVS-RESP-no-ddname              value 104.
               88  MVS-RESP-ddget-err              value 111.
               88  MVS-RESP-ddupd-err              value 112.
               88  MVS-RESP-getcat-err             value 121.
               88  MVS-RESP-updcat-err             value 122.
           05  MVS-RESPOND2            pic 9(8)    comp.
      *        Job Information
           05  MVS-JOB-INFORMATION.
               10  MVS-JOBNAME             pic X(8).
               10  MVS-JOBID               pic X(8).
               10  MVS-JOBSTEP             pic X(8).
               10  MVS-PROCSTEP            pic X(8).
               10  MVS-JOB-USERID          pic X(8).
               10  MVS-JOB-CLASS           pic X.
               10  MVS-JOB-MSGCLASS        pic X.
               10  MVS-LOAD-MODULE         pic X(8).
               10  MVS-JOB-ACCOUNT         pic X(144).
               10  MVS-JOB-PROGRAMMER      pic X(20).
               10  MVS-JOB-START-DATE      pic 9(8).
               10  MVS-JOB-START-TIME      pic 9(8).
               10  MVS-STEP-START-DATE     pic 9(8).
               10  MVS-STEP-START-TIME     pic 9(8).
      *        File Information
           05  MVS-FILE-INFORMATION.
               10  MVS-DSORG               pic X(4).
               10  MVS-RECFM               pic X(4).
               10  MVS-DATACLAS            pic X(8).
               10  MVS-DISP-INIT           pic X(4).
               10  MVS-DISP-NORM           pic X(8).
               10  MVS-DISP-COND           pic X(8).
               10  MVS-LRECL-JCL           pic 9(06).
               10  MVS-LRECL-MIN           pic 9(06).
               10  MVS-LRECL-MAX           pic 9(06).
               10  MVS-BLKSIZE             pic 9(06).
               10  MVS-KEYOFF              pic 9(06).
               10  MVS-KEYLEN              pic 9(03).
               10  MVS-DDNAME              pic X(8).
               10  MVS-DSNAME              pic X(44).
               10  MVS-DSNAME-MBR          pic X(08).
               10  MVS-PCDSN               pic X(260).
      ***  JQUERYB1 - End-of-Copy File - - - - - - - - - - - JQUERYB1 *
      *****************************************************************
      *


Table of Contents Previous Section Next Section Summary

This sample program demonstrates how to access JCL specifications from a COBOL program using the SimoTime Job Query program. This document may be used to assist as a tutorial for new assembler programmers or as a quick reference for experienced programmers. The samples focus on the coding techniques of the individual instructions. As always, it is the programmer's responsibility to thoroughly test all programs.

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 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 the Assembler Connection for more examples of mainframe Assembler programming techniques and sample code.

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connect.

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

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

Table of Contents Previous Section Next Section Glossary of Terms

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

Table of Contents Previous Section Next Section Contact or Feedback

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

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

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

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

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

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

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


Return-to-Top
JOB and DD Query, COBOL Access to JCL Specifications
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com