SLEEP or WAIT State Micro Focus COBOL Environment |
The SimoTime Home Page |
When a job is submitted to a JES Region (or Server) within Micro Focus Enterprise Server to run batch jobs (i.e. submit JCL) it is sometimes a requirement to wait and monitor the results of an asynchronous process. This example will focus on Micro Focus Enterprise Server and the Mainframe Sub-System (or ES/MSS) and the use of a WAIT (or SLEEP) function. This function will cause a delay in processing for the amount of time specifed by the user.
The programs in this example are expected to run in a Micro Focus Enterprise Server and Mainframe Sub-System environment. The callable WAIT Routine is specifically coded for the Micro Focus environment.
We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
This section describes the simple tasks required to compile the sample programs. This suite of sample programs contains two COBOL programs and one COBOL copy file. The first COBOL program (CBWAITC1.cbl) is a test program that will call the WAIT or SLEEP routine (MFWAITER.cbl). A COBOL copy file defines the pass area or programming interface that is used for the passing or sharing of information between the COBOL programs or the JCL and the COBOL wait routine. Two directives files are used to document and define the compiler options (or directives).
The following (PAWAITER.cpy) is the source code for the COBOL Copy File that is used by CBWAITC1 to call MFWAITER.
***************************************************************** * PAWAITER is a COBOL Copy File * * Data Structure or Pass Area used for calling MFWAITER. * * Copyright (C) 1987-2019 SimoTime Technologies * * All Rights Reserved * ***************************************************************** * Provided by SimoTime Technologies * * Our e-mail address is: helpdesk@simotime.com * * Also, visit our Web Site at http://www.simotime.com * ***************************************************************** * The value of MFWAITER-LENGTH must be 11 or 8. * The leftmost bytes of MFWAITER-TIME must be as follows. * * THE FORMAT OF THE WAIT/DELAY PARM IS HH:MM:SS:CC * OR HH:MM:SS * HH Hours * MM Minutes * SS Seconds * CC Hundreths of a Second * 01 MFWAITER-PASS-AREA. 05 MFWAITER-LENGTH PIC 9(03) comp. 05 MFWAITER-TIME PIC X(80). * *** PAWAITER - End-of-Copy File - - - - - - - - - - - PAWAITER * ***************************************************************** *
Note: You may view additional information about the MFWAITER Program at mfwaiter.htm.
The COBOL Test program (CBWAITC1.cbl) is a program that will call the WAIT or SLEEP routine (MFWAITER.cbl). It is coded to be mainframe compliant and the use of the OS390 (or later) dialect is recommended and supported for execution in a Micro Focus environment.
The following (OS390AscCBLBAT.DIR) shows the content of the directives file that is used to compile the test program.
DIALECT"OS390" CHARSET"ASCII" ASSIGN"EXTERNAL" IDXFORMAT"8" IBMCOMP NOTRUNC HOSTNUMMOVE HOSTNUMCOMPARE NOSIGNFIXUP HOSTARITHMETIC CHECKNUM NOOPTIONAL-FILE NOQUERY COBIDY ANIM outdd"SYSOUT 121 L" SHARE-OUTDD DATAMAP settings list() noformWIP
The following (CBWAITC1.cbl) is the source code for the COBOL Test program.
IDENTIFICATION DIVISION. PROGRAM-ID. CBWAITC1. AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** DATA DIVISION. WORKING-STORAGE SECTION. ***************************************************************** * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* CBWAITC1 '. 05 MESSAGE-TEXT. 10 MESSAGE-TEXT-1 pic X(68) value SPACES. 10 MESSAGE-TEXT-2 pic X(188) value SPACES. COPY PAWAITER. ***************************************************************** PROCEDURE DIVISION. add 11 to ZERO giving MFWAITER-LENGTH move '00:00:15:00' to MFWAITER-TIME call 'MFWAITER' using MFWAITER-PASS-AREA GOBACK. ***************************************************************** * Display CONSOLE messages... * ***************************************************************** Z-DISPLAY-MESSAGE-TEXT. if MESSAGE-TEXT-2 = SPACES display MESSAGE-BUFFER(1:79) else display MESSAGE-BUFFER end-if move all SPACES to MESSAGE-TEXT exit.
Explore How to put a program into a SLEEP or WAIT state by calling a shared executable member, the SLEEP or WAIT time is user defined.
This section describes the JCL Member to test the configuration of Enterprise Server and the Configuration File and the expected results.
Two JCL Members are supplied with this suite of sample programs. The first job will execute a test programs that determines the wait time and calls the wait routine. The second JCL member uses the PARM= function to define the wait time and executes the wait routine direction from the EXEC statement.
This JCL Member (CBWAITJ1.jcl) will execute a COBOL program that calls the wait routine. The wait time is based on a value specified within the calling program.
//CBWAITJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBWAITJ1.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 - Test for the MFWAITER Sleep Routine with a COBOL program. //* Author - SimoTime Technologies //* Date - January 24, 1999 //* //* This set of programs will run in a Micro Focus Environment. //* //* ******************************************************************* //* Step 1 of 1, Test for the MFWAITER Sleep Routine //* Note: CBWAITC1 will call MFWAITER to wait 15 seconds. //* //WAITSTEP EXEC PGM=CBWAITC1 //SYSOUT DD SYSOUT=*
This JCL Member (CBWAITJ2.jcl) will execute the wait routine. The wait time is based on a value specified using the PARM= keyword on the EXEC statement of the JCL member.
//CBWAITJ2 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 //* ******************************************************************* //* CBWAITJ2.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 - Test the MFWAITER Sleep Routine using a JCL Parameter. //* Author - SimoTime Technologies //* Date - January 24, 2006 //* //* THE FORMAT OF THE WAIT/DELAY PARM IS HH:MM:SS:CC //* OR HH:MM:SS //* HH Hours //* MM Minutes //* SS Seconds //* CC Hundreths of a Second //* ******************************************************************* //* Step 1 of 1, This is a single step job... //WAIT10SS EXEC PGM=MFWAIT4Z,PARM='00:00:10:00' //*
Two JCL Members are supplied with this suite of sample programs. The first job will execute a test programs that determines the wait time and calls the wait routine. The second JCL member uses the PARM= function to define the wait time and executes the wait routine direction from the EXEC statement.
This example executes a COBOL Test Program (PGM=CBWAITC1) that determines a WAIT (SLEEP or DELAY) time of five (5) seconds and calls a WAIT Routine.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* *-*-* Micro Focus ESJCL ASCII JES2 Version SEE60.02.00.000_20110524 *-*-* *-*-* Copyright (C) Micro Focus IP Development Limited 1997-2011. All rights reserved. *-*-* *-*-* Job: 18232 Name: CBWAITJ1 User: mfuser Date: 12/04/14 Time: 10:07:56 *-*-* *-*-* File: $TXRFDIR/MFUSER10075679.T *-*-* *-*-* DSN: *-*-* *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 1 //CBWAITJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 2 //* ******************************************************************* 3 //* CBWAITJ1.JCL - a JCL Member for Batch Job Processing * 4 //* This JCL Member is provided by SimoTime Technologies * 5 //* (C) Copyright 1987-2015 All Rights Reserved * 6 //* Web Site URL: http://www.simotime.com * 7 //* e-mail: helpdesk@simotime.com * 8 //* ******************************************************************* 9 //* 10 //* Text - Test for the MFWAITER Sleep Routine with a COBOL program. 11 //* Author - SimoTime Technologies 12 //* Date - January 24, 1999 13 //* 14 //* This set of programs will run in a Micro Focus Environment. 15 //* 16 //* ******************************************************************* 17 //* Step 1 of 1, Test for the MFWAITER Sleep Routine 18 //* 19 //WAITSTEP EXEC PGM=CBWAITC1 20 //SYSOUT DD SYSOUT=* **** JCLCM0180I Job ready for execution. **** Execution on Server SIMOACCA Process 43228 10:07:57 JCLCM0188I JOB STARTED 10:07:57 JCLCM0190I STEP STARTED WAITSTEP 10:07:57 JCLCM0199I Program CBWAITC1 is COBOL VSC2 ASCII Big-Endian NOAMODE. MFE2014.S1204.S100756.J18232.D00001.SYSOUT SYSOUT C:\SIMOSAM1\DEVL\DATA\SPOOL\MFE2*100756.J18232.D00001.SYSOUT.DAT REMOVED ---> 10:08:12 JCLCM0191I STEP ENDED WAITSTEP - COND CODE 0000 ---> 10:08:12 JCLCM0182I JOB ENDED - COND CODE 0000
The preceding job would normally run in a few milliseconds. However, with the delay the job will take a minimum of fifteen (15) seconds to execute. Notice the highlighted STARTED and ENDED times for the job step.
This example executes the COBOL WAIT Routine (PGM=MFWAITER,PARM='00:00:10') directly from JCL. The WAIT (SLEEP or DELAY) time of ten (10) seconds is defined in the PARM= value and passed to the WAIT Routine.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* *-*-* Micro Focus ESJCL ASCII JES2 Version SEE60.02.00.000_20110524 *-*-* *-*-* Copyright (C) Micro Focus IP Development Limited 1997-2011. All rights reserved. *-*-* *-*-* Job: 18233 Name: CBWAITJ2 User: mfuser Date: 12/04/14 Time: 10:08:14 *-*-* *-*-* File: $TXRFDIR/MFUSER10081407.T *-*-* *-*-* DSN: *-*-* *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-* 1 //CBWAITJ2 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1 2 //* ******************************************************************* 3 //* CBWAITJ2.JCL - a JCL Member for Batch Job Processing * 4 //* This JCL Member is provided by SimoTime Technologies * 5 //* (C) Copyright 1987-2015 All Rights Reserved * 6 //* Web Site URL: http://www.simotime.com * 7 //* e-mail: helpdesk@simotime.com * 8 //* ******************************************************************* 9 //* 10 //* Text - Test the MFWAITER Sleep Routine using a JCL Parameter. 11 //* Author - SimoTime Technologies 12 //* Date - January 24, 2006 13 //* 14 //* THE FORMAT OF THE WAIT/DELAY PARM IS HH:MM:SS:CC 15 //* OR HH:MM:SS 16 //* HH Hours 17 //* MM Minutes 18 //* SS Seconds 19 //* CC Hundreths of a Second 20 //* ******************************************************************* 21 //WAIT10SS EXEC PGM=MFWAIT4Z,PARM='00:00:10:00' 22 //* **** JCLCM0180I Job ready for execution. **** Execution on Server SIMOACCA Process 43228 10:08:15 JCLCM0188I JOB STARTED 10:08:15 JCLCM0190I STEP STARTED WAIT10SS 10:08:15 JCLCM0199I Program MFWAIT4Z is COBOL VSC2 ASCII Big-Endian NOAMODE. ---> 10:08:25 JCLCM0191I STEP ENDED WAIT10SS - COND CODE 0000 ---> 10:08:25 JCLCM0182I JOB ENDED - COND CODE 0000
The preceding job would normally run in a few milliseconds. However, with the delay the job will take a minimum of ten (10) seconds to execute. Notice the highlighted STARTED and ENDED times for the job step.
This example will focus on Micro Focus Enterprise Server and the Mainframe Sub-System (or ES/MSS) and the use of a WAIT (or SLEEP) function. 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 sub-section requires an internet connection, the second sub-section references locally available documents.
Note: A SimoTime License is required for the items to be made available on a local server.
The following links may be to the current server or to the Internet.
Explore How to put a program into a SLEEP or WAIT state by calling a shared executable member, the SLEEP or WAIT time is user defined.
Explore a complete list of the SimoTime Callable Routines or Utility Programs. This includes the callable routines and utility programs for the Micro Focus environment.
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.
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
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 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 |
Programmable SLEEP or WAIT State for Micro Focus COBOL using CBL_THREAD_SLEEP |
Copyright © 1987-2025 SimoTime Technologies and Services All Rights Reserved |
When technology complements business |
http://www.simotime.com |