Model or Stub Template COBOL Program or Called Routine |
The SimoTime Home Page |
This program is a stub or starter program when creating a new COBOL program or callable sub-routine. It can accept a parameter from the PARM= keyword of the EXEC statement in JCL. It will call the SIMODUMP program to do a HEX-Dump of a of a user-defined data string.
This suite of programs requires a Windows System with Micro Focus Enterprise Server and the SimoTime Library.
Explore the SIMOTIME Web Site for additional information about the technologies and services that are available.
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 illustrates the following functions.
1. | Demonstrate how to create a new COBOL program or callable subroutine using a template program. |
2. | Demonstrate how to use external switches or environment variables to control program behavior. |
3. | Demonstrate how to access the data string defined using the PARM= function on the EXEC statement of the JCL member. |
4. | Demonstrate how to write to a SYSOUT device. |
The preceding is a list of the Batch Job Objectives.
The following shows an example of the results produced by this sample job.
* STSTUBC1 Enter, PROCEDURE DIVISION * STSTUBC1 COBOL example of a STUB Program v16.06.15 http://www.simotime.com * STSTUBC1 Copyright 1987-2016 SimoTime Technologies All Rights Reserved * STSTUBC1 PARM=PARAMETER STRING FROM JCL MEMBER * STSTUBC1 Enter, TAG90, User Defined Trace * SIMODUMP COBOL Hexadecimal Dump Routine v16.06.15 http://www.simotime.com * SIMODUMP Copyright 1987-2016 SimoTime Technologies All Rights Reserved * SIMODUMP Accepted User Request, increase Buffer Size maximum limit to 00256 * SIMODUMP ADDR is 0000000020244800 * SIMODUMP Starting, SIMODUMP-ID is STUBTEST, Dump Buffer size is 0157 Address Hex..... ........ ........ ........ ebcdic.......... ascii........... 20244800 4559452D 43415443 4845522D 53544152 ................ EYE-CATCHER-STAR 30244800 542E2E2E 00123F00 00007F30 30323536 .........."..... T.....?....00256 40244800 30303235 36525952 59525952 59525952 ................ 00256RYRYRYRYRYR 50244800 59525952 59525952 59494849 48494849 ................ YRYRYRYRYIHIHIHI 60244800 48494849 48494849 48494849 48584F58 ..............|. HIHIHIHIHIHIHXOX 70244800 4F584F58 4F584F58 4F584F58 4F584F58 |.|.|.|.|.|.|.|. OXOXOXOXOXOXOXOX 80244800 4F414243 44454647 48494A4B 4C4D4E4F |...........<(+| OABCDEFGHIJKLMNO 90244800 50515253 54555657 58595A30 31323334 &.........!..... PQRSTUVWXYZ01234 A0244800 35363738 39214023 242E2E2E 4559452D ...... ......... 56789!@#$...EYE- B0244800 43415443 4845522D 454E4445 44xxxxxx .........+...... CATCHER-ENDED... * STSTUBC1 Leave, TAG90, User Defined Trace * STSTUBC1 Leave, PROCEDURE DIVISION
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 SIMODUMP is a SimoTime utility 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.
The following diagram shows the logic flow for a batch job that describes and demonstrates how to us a template to create a new COBOL program with HEX-dump capability.
Color Associations: The Execute the Batch JobThis 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 -j..\STSTUBJ1.JCL -rSIMOBATA Technical DetailsThis section provides additional technical details about the modules that are included in the batch job example. The JCL MemberThe following is a JCL member(STSTUBJ1.jcl) used to run the COBOL program. //STSTUBJ1 JOB SIMOTIME,CLASS=1,MSGCLASS=0,NOTIFY=CSIP1,USER=SIMOTIME //* ******************************************************************* //* STSTUBJ1.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 - Execute the COBOL Stub Program //* Author - SimoTime Technologies //* Date - January 24, 1996 //* //* ******************************************************************* //* Step 1 of 1, Execute the program... //* //STSTUBS1 EXEC PGM=STSTUBC1,PARM='PARAMETER STRING FROM JCL MEMBER' //SYSOUT DD SYSOUT=* // The COBOL Source MembersThis sample job uses the following COBOL source members to build the executable load member that accesses the stub program. The Sample COBOL ProgramThis program (STSTUBC1.cbl) is the source member that is used as a COBOL stub or model program for creating a new program or callable sub-routine.. IDENTIFICATION DIVISION. PROGRAM-ID. STSTUBC1. *AUTHOR. SIMOTIME TECHNOLOGIES. ***************************************************************** * Copyright (C) 1987-2018 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: STSTUBC1.CBL * Copy Files: PASSDUMP.CPY * Calls to: SIMODUMP ***************************************************************** * * STSTUBC1 - A COBOL Stub program. * * CALLING PROTOCOL * ---------------- * Use standard procedure to RUN or ANIMATE. * * DESCRIPTION * ----------- * This program is a stub or starter program when creating a new * COBOL program or callable sub-routine. It can accept a * parameter from the PARM= keyword of the EXEC statement in JCL. * It will call the SIMODUMP program to do a HEX-Dump of a of a * user-defined data string. * * ************ * * STSTUBJ1 * * ********jcl* * * * * * ************ ************ * * STSTUBC1 *-----* SYSOUT * * ********cbl* ************ * * * * * ************ ************ * * SIMODUMP *-----* SYSOUT * * ********cbl* ************ * * This program calls SIMODUMP to write HEX Dump information * to SYSOUT of a user-defined data string. * ***************************************************************** * * MAINTENANCE * ----------- * 1989/02/27 Simmons, Created program. * ***************************************************************** * DATA DIVISION. WORKING-STORAGE SECTION. ***************************************************************** * Data-structure for Title and Copyright... * ------------------------------------------------------------ 01 SIM-TITLE. 05 T1 pic X(11) value '* STSTUBC1 '. 05 T2 pic X(34) value 'COBOL example of a STUB Program '. 05 T3 pic X(10) value ' v16.06.15'. 05 T4 pic X(24) value ' http://www.simotime.com'. 01 SIM-COPYRIGHT. 05 C1 pic X(11) value '* STSTUBC1 '. 05 C2 pic X(20) value 'Copyright 1987-2018 '. 05 C3 pic X(28) value ' SimoTime Technologies '. 05 C4 pic X(20) value ' All Rights Reserved'. ***************************************************************** * Message Buffer used by the Z-POST-MESSAGE-TO-SYSOUT routine. * ***************************************************************** 01 MESSAGE-BUFFER. 05 MESSAGE-HEADER pic X(11) value '* STSTUBC1 '. 05 MESSAGE-TEXT pic X(256) value SPACES. 01 MSG-LSB pic 9(3) value 256. 01 DATA-GROUP. 05 FLD-000 pic X(20) value 'EYE-CATCHER-START...'. 05 FLD-001 pic 9(5) comp-3 value 123. 05 FLD-002 pic 9(5) comp value 127. 05 FLD-003 pic 9(5) value 256. 05 FLD-004 pic S9(5) value 256. 05 FLD-005 pic X(20) value 'RYRYRYRYRYRYRYRYRYRY'. 05 FLD-006 pic X(20) value 'IHIHIHIHIHIHIHIHIHIH'. 05 FLD-007 pic X(20) value 'XOXOXOXOXOXOXOXOXOXO'. 05 FLD-008 pic X(20) value 'ABCDEFGHIJKLMNOPQRST'. 05 FLD-009 pic X(20) value 'UVWXYZ0123456789!@#$'. 05 FLD-999 pic X(20) value '...EYE-CATCHER-ENDED'. 01 FMT-FOR-LOCATION. 05 FMT-ADDRESS pic X(16) value 'FORMAT=ADDRESS '. 05 FMT-POSITION pic X(16) value 'FORMAT=POSITION '. 05 FMT-OFFSET pic X(16) value 'FORMAT=OFFSET '. 05 FMT-LIMIT-SZ pic X(16) value 'LIMIT=00256 '. COPY PASSDUMP. COPY BFLAGSB1. ***************************************************************** LINKAGE SECTION. 01 PARM-DATA. 04 PARM-LN PIC 9(3) USAGE BINARY. 04 PARM-ST PIC X(127). ***************************************************************** PROCEDURE DIVISION USING PARM-DATA. move 'NNNNNNNN/YYNNNNNN' to BF-GROUP if BF-T1 = 'Y' move 'Enter, PROCEDURE DIVISION' to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT end-if perform Z-POST-COPYRIGHT-TO-SYSOUT if PARM-LN > 0 and < 128 display '* STSTUBC1 PARM=' PARM-ST(1:PARM-LN) end-if if BF-T2 = 'Y' move 'Enter, TAG90, User Defined Trace' to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT perform SIMODUMP-CONFIGURE add length of DATA-GROUP to ZERO giving SIMODUMP-LENGTH call 'SIMODUMP' using SIMODUMP-PASS-AREA DATA-GROUP move 'Leave, TAG90, User Defined Trace' to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT end-if if BF-T1 = 'Y' move 'Leave, PROCEDURE DIVISION' to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT end-if GOBACK. ***************************************************************** SIMODUMP-CONFIGURE. move 'USER' to SIMODUMP-REQUEST move 'STUBTEST' to SIMODUMP-DUMP-ID move 'OUT1' to SIMODUMP-OUTPUT move 'KEEP' to SIMODUMP-COPYRIGHT call 'SIMODUMP' using SIMODUMP-PASS-AREA FMT-ADDRESS call 'SIMODUMP' using SIMODUMP-PASS-AREA FMT-LIMIT-SZ move 'DUMP' to SIMODUMP-REQUEST exit. ***************************************************************** Z-POST-COPYRIGHT-TO-SYSOUT. move SIM-TITLE(12:68) to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT move SIM-COPYRIGHT(12:68) to MESSAGE-TEXT perform Z-POST-MESSAGE-TO-SYSOUT exit. ***************************************************************** Z-POST-MESSAGE-TO-SYSOUT. perform Z-CALCULATE-MSG-LENGTH display MESSAGE-BUFFER(1:MSG-LSB) move all SPACES to MESSAGE-TEXT exit. ***************************************************************** Z-CALCULATE-MSG-LENGTH. 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 exit. Copy File for PASSDUMPThis source member (PASSDUMP.cpy) is the COBOL copy file that defines the data structure (or Pass Area) that is used when calling the SIMODUMP program. ***************************************************************** * PASSDUMP is a COBOL Copy File * * Data Structure or Pass Area used for calling SIMODUMP. * * 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 * ***************************************************************** * Values for SIMODUMP-REQUEST * * DUMP Dump the Buffer in Hexadecimal format * * NOTE Display or Write the text to the screen or log file * * * * Values for SIMODUMP-SYSOUT * * OPR1 Display dump information on operator console * * OPR2 Display to operator console and write to log file * * OUT1 Display dump information to SYSOUT device * * OUT2 Display to SYSOUT device and write to log file * * LOG1 Write dump information to the log file (SYSLOG) * * NONE Do not output to screen or file, put dump info in * * pass area table and return to caller. * * * * Values for SIMODUMP-COPYRIGHT * * HIDE Do not display the copyright information. Any other * * entry will display the copyright information. * ***************************************************************** 01 SIMODUMP-PASS-AREA. * Initial information is provided by the calling program, * The SIMODUMP-REQUEST field will be modified to "DUMP" if it * does not contain a valid entry. * The SIMODUMP-RESULT field may also be modified by the * SimoDUMP routine. 05 SIMODUMP-REQUEST PIC X(4). 05 SIMODUMP-RESULT PIC 9999. * The following are not modified by the SimoDUMP routine... 05 SIMODUMP-DUMP-ID PIC X(8). 05 SIMODUMP-OUTPUT PIC X(4). 05 SIMODUMP-COPYRIGHT PIC X(4). * The following are modified by the SimoDUMP routine... 05 SIMODUMP-IDX PIC 99. 05 SIMODUMP-LINES PIC X(80) OCCURS 8 TIMES. * The following are not modified by the SimoDUMP routine... 05 SIMODUMP-LENGTH PIC 9(4). 01 SIMODUMP-BUFFER PIC X(128). * *** PASSDUMP - End-of-Copy File - - - - - - - - - - - PASSDUMP * ***************************************************************** * Copy File for BFLAGSB1This source member (BFLAGSB1.cpy) is the COBOL copy file that defines the data structure for the Behavior and Trace flags. ***************************************************************** * BFLAGSB1.cpy - a COBOL Copy Member * * Program Behavior Flags used by the Demo programs. * * 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 * ***************************************************************** * 01 BF-GROUP. 05 BF-FLAGS. 10 BF-01 PIC X. 10 BF-02 PIC X. 10 BF-03 PIC X. 10 BF-04 PIC X. 10 BF-05 PIC X. 10 BF-06 PIC X. 10 BF-07 PIC X. 10 BF-08 PIC X. 05 BF-SLASH PIC X. 05 BF-TRACE. 10 BF-T1 PIC X. 10 BF-T2 PIC X. 10 BF-T3 PIC X. 10 BF-T4 PIC X. 10 BF-T5 PIC X. 10 BF-T6 PIC X. 10 BF-T7 PIC X. 10 BF-T8 PIC X. * *** BFLAGSB1 - End-of-Copy File - - - - - - - - - - - BFLAGSB1 * ***************************************************************** * SummaryThis program is a stub or starter program when creating a new COBOL program or callable sub-routine. 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. Software Agreement and DisclaimerPermission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Technologies. Once the fee is received by SimoTime the latest version of the software, documentation or training material will be delivered and a license will be granted for use within an enterprise, provided the SimoTime copyright notice appear on all copies of the software. The SimoTime name or Logo may not be used in any advertising or publicity pertaining to the use of the software without the written permission of SimoTime Technologies. SimoTime Technologies makes no warranty or representations about the suitability of the software, documentation or learning material for any purpose. It is provided "AS IS" without any expressed or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Technologies shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material. Downloads and LinksThis section includes links to documents with additional information that are beyond the scope and purpose of this document. The first group of documents may be available from a local system or via an internet connection, the second group of documents will require an internet connection. Note: A SimoTime License is required for the items to be made available on a local system or server. Current Server or Internet AccessThe following links may be to the current server or to the Internet. Explore the COBOL Connection for more examples of COBOL 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. Internet Access RequiredThe 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. Glossary of TermsExplore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers. Comments or FeedbackThis document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.
We appreciate hearing from you. Company OverviewSimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems. Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms. Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment. Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com
|