The COBOL Connection
Examples and Reference Material
  Table of Contents  v-24.01.01 - indexcbl.htm 
  Introduction
  Shared Routines & Driver Programs
  The Customer Master File
  The Item Master File
  COBOL Dialects
  The Sample COBOL Programs
  Case Conversion with COBOL
  Procedure Pointer, External Data Items
  Collating Sequence, EBCDIC & ASCII
  Copy File with Replacing Function
  Replace -INC with Standard Copy
  Data Access Programming Examples
  Creating Simple Test Files
  Alternate Index for VSAM, KSDS
  Callable Access, Sequential 80-Byte Records
  Comma-Separated-Values or CSV Files
  Create a New CSV File
  Read and Parse an Existing CSV File
  Relational Data Base, Embedded SQL
  Relational Table for Customer Information
  Relational Table for Item or Product Information
  Generation Data Groups (GDG's)
  QSAM Processing Techniques
  Single COBOL Program
  COBOL with a COBOL I/O Routine
  COBOL with an Assembler I/O Routine
  VSAM Processing Techniques
  KSDS, Single COBOL Program
  KSDS, COBOL with a COBOL I/O Routine
  KSDS, COBOL with an Assembler I/O Routine
  ESDS, Create & Add Records, JCL & COBOL
  RRDS, Create & Add Records, JCL & COBOL
  Data File Processing, Multiple Record Types
  Files with Variable Length Records
  Process using Standard COBOL
  Process using Byte-Stream I/O
  Variable, Transfer, Share, Convert, Compare
  Call SORT from a COBOL Program
  Large Micro Focus Files (greater than 2-gig)
  Data Fields (Edit, Modify & Validate)
  Data Fields (Hexadecimal Content)
  Remove Binary Content then Print or Display
  Data Fields (Text or Alpha-Numeric Content)
  Left, Center or Right Justify a Text Field
  Process Leading & Multiple, Embedded Spaces
  Text Field, Pass, Parse & Convert a Data String
  Text Field, Search & Replace a Text String
  Data Fields (Numeric Content)
  How to Manage Various Numeric Formats
  Numeric Field, Right-Adjust and Zero-Fill
  Numeric Field, Common Formats & Sizes
  Numeric Field, Testing or Scanning
  Numeric Field, Printing and Editing
  Numbers to Words or Digits to Text
  Numeric Field, Leading Spaces and Zeroes
  Numeric Field, Convert between Formats
  Convert, CSV & Fixed-Field-Length
  Data Fields (Bit Processing)
  Bit Manipulation
  Boolean Logical AND
  Boolean Logical OR
  Boolean Exclusive OR (XOR)
  Date Validate, Format and Convert
  Date Calculation, Difference in Days
  Environment, CMD Line & File Names
  Data Convert &Transfer Alternatives
  Convert, EBCDIC & ASCII, QSAM & VSAM
  Transfer & Convert, Host to PC to Host
  EBC to ASC, Text String Only
  EBC to ASC, Binary, Numeric & Text Strings
  File Status Codes, Program Access
  Floating Point Arithmetic
  Internal Reader (INTRDR), Submit Job
  Read KSDS, Sort & Print Mailing Labels
  Micro Focus Environment
  Compiler Directives
  Scripted Application Build
  Compiler or Link For INT, GNT or EXE
  Callable WAIT Function
  JOB Query of JCL from COBOL
  Parameter Passing from JCL
  Street Address Parse, Edit & Format
  Stub or Model Program
  Table Processing
  Define, Load, Search & Sort a Table
  Bubble Sort for Table
  Create or Define a Table of Binary Values
  Tips & Techniques for COBOL
  Diagnostic Aids
  SYSOUT to Console or File
  Hexadecimal Notation
  STPEEK01, Peek at a Memory Segment
  Embedded Hex Characters in Source Code
  Hex-Dump of Fields or Data Items
  Hex-Dump of Storage or Memory
  Hex-Dump of Sequential Files
  Hex-Dump of VSAM Data Set
  Hex-Dump of Customer Master
  Hex-Dump, COBOL calling COBOL
  Hex-Dump, Single COBOL Program
  Snap Dump of Working Storage
  ABEND, Micro Focus Environment
  ABEND, User Terminates Program Execution
  ABEND, Problem Determination, Job Restart
  ABEND, RTS0114, CORE_ON_ERROR
  Program Tracking and Elapsed Time
  Compare Directory Content
  Java and COBOL
  Java, COBOL and Micro Focus
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview

Table of Contents Previous Section Next Section Introduction

COBOL is an acronym for "COmmon Business Oriented Language". The COBOL Connection provides a suite of test cases that were developed using the COBOL programming language. The programs were originally written to be in compliance with the IBM VS COBOL II dialect with few exceptions. For example, programs that access the system date may require the COBOL/390 dialect (or later) to be Y2K compliant.

The intent is to provide programs that are compliant with the ANSI standard and many of the programs are coded to the ANSII'85 standard with the exception of programs that use hexadecimal notation (i.e. value X'1F'). The Hexadecimal notation was originally a COBOL II syntax and later became part of the ANSI/2000 standard. Also, many of the programs will work with COBOL for MVS, COBOL/370 and COBOL/390.

A few programs use non-mainframe syntax and are documented as such and will not run on the mainframe. These programs are intended for a Linux, UNIX or Windows platform running Micro Focus COBOL or GnuCOBOL. JCL members are provided to run the batch jobs as MVS (or ZOS) batch jobs on an IBM Mainframe System or as a project with Micro Focus Mainframe Express (MFE) running on a Windows System.

The COBOL programs may be compiled using Micro Focus Net Express running on Windows. In the Net Express environment it may be necessary to make adjustments for the ASCII environment and the mapping of the logical COBOL file names to the physical (or actual) file names used by the Operating System. The replacement of JCL with BAT or CMD files is optional.

In the early 2000's or just after the turn of the century Micro Focus delivered Enterprise Server and Studio (Server is for production deployment and Studio is for the development environment). This technology provided companies with the ability to move batch job processing and transaction processing (on line applications) between a Mainframe System and a Linux, UNIX and Windows System. The process of moving and preparing the applications requires the Micro Focus Server or Studio to be installed and configured. The application source code is moved, compiled and executed on the target platform.

The batch COBOL programs have been compiled and tested using GnuCOBOL running on a Linux (Ubuntu 16.04) System. In the Linux environment it may be necessary to make adjustments for the ASCII environment and the mapping of the logical COBOL file names to the physical (or actual) file names used by the Operating System. Bash Script Files are used to prepare the job environment and execute the COBOL programs.

Most of the COBOL programs may be compiled and executed on a Linux, UNIX or AS/400 System. SIMOTIME does not formally test all of the programs in these environments. However, we do have customers that have used many of the programs in these environments.

Today, for the Windows environment our primary system of choice for individual programmers and unit testing is Windows/7 with Micro Focus Enterprise Studio. For the Linux environment our primary system of choice for individual programmers and unit testing is Ubuntu 16.04 LTS with GnuCOBOL 2.0.

Micro Focus Enterprise Server provides the foundation platform (or sub-system) that allows applications that are currently running on a Mainframe System with ZOS to be copied (at the source code level) to a Linux, UNIX or Windows System and then compiled and executed. Refer to http://www.microfocus.com for more information.

GnuCOBOL (formerly OpenCOBOL) is a free COBOL compiler. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. Refer to https://sourceforge.net/projects/open-cobol/ for more information.

Many of the applications (sometimes referred to as Legacy Applications) running on IBM Mainframes are written in COBOL and have been providing mission critical business information for ten years or longer. Some applications or parts of an application were written over twenty-five years ago. The mainframe continues to be the largest, single platform running applications that leverage the use of the COBOL language. However, it is important to note that COBOL source code that adheres to the ANSI'85 standard may be easily moved or copied between a Mainframe System, a Linux System, a UNIX System or a Windows System. Once the source code has been copied or moved it may be compiled and executed on target system.

The advantages and disadvantages of the proliferation, maintenance or replacement of COBOL applications are not discussed. The COBOL Connection uses a simple value proposition - Legacy Applications, longevity based on continued business value.


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

Table of Contents Previous Section Next Section Shared Routines & Driver Programs

This is a collection of the common callable routines and driver programs that may be used by many of the COBOL sample programs provided by SimoTime Enterprises. The COBOL programs are written using the COBOL/2 or COBOL/390 dialect but also work with COBOL for MVS, COBOL/370 and COBOL/390. The date and logging routines require COBOL/390 to be Y2K compliant. Simply click on one of the following items for more information.

Link Tag Description
SIMOMODS Learn more by viewing the documentation for the shared modules
SIMOMODSexec Download an evaluation copy of the executable members for the shared modules
SIMOMODScode Download an evaluation copy of the source code for the shared modules
  SIMOMODS, Shared Callable Routines & Driver Programs

Table of Contents Previous Section Next Section The Customer Master File

On the IBM Mainframe the Customer Master File is a VSAM Keyed Sequential Data Set (referred to as KSDS). On a Windows or UNIX System using Micro Focus the Customer Master File is an Indexed File or Key Sequenced File.

The Customer Master file contains variable length records with the minimum and average record length being the same length of 512 bytes. The key starts in the first position of the record and is 12 bytes in length. The record layout is defined in a COBOL copy file and contains text strings and various numeric formats including zoned-decimal, packed and binary.

This program suite provides an example of how to create and populate a Customer Master File. On the Mainframe System the file is a VSAM, Key-Sequenced-Data-Set (or KSDS). On a Windows or UNIX System the Micro Focus Indexed File format is used. The file contains 512 byte records and the key (or customer number) is twelve (12) bytes starting in the first position of each record.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section The Item Master File

On the IBM Mainframe the Item Master File is a VSAM Keyed Sequential Data Set (referred to as KSDS). On a Windows or UNIX System using Micro Focus the Item Master File is an Indexed File or Key Sequenced File.

The Item Master file contains variable length records with the minimum and average record length being the same length of 512 bytes. The key starts in the first position of the record and is 12 bytes in length. The record layout is defined in a COBOL copy file and contains text strings and various numeric formats including zoned-decimal, packed and binary.

This program suite provides an example of how to create and populate the Item Master File. On the Mainframe System the file is a VSAM, Key-Sequenced-Data-Set (or KSDS). On a Windows or UNIX System the Micro Focus Indexed File format is used. The file contains 512 byte records and the key (or item number) is twelve (12) bytes starting in the first position of each record.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section COBOL Dialects

The creation of the COBOL specifications were started in 1959 and by the end of 1960 the same COBOL source code was compiled and executed on two different computers with different hardware architectures. Since that time the specifications for COBOL have evolved, expanded and improved. The following is an overview of the popular COBOL dialects.

Link to Internet   Link to Server   Explore an Overview of the COBOL Dialects and some coding syntax tips and techniques.

Table of Contents Previous Section Next Section The Sample COBOL Programs

This section provides a brief description of each of the sample COBOL programs. Also, a link for downloading or accessing detailed information is provided.

Table of Contents Previous Section Next Section Case Conversion with COBOL

This is an example of how COBOL programs do case conversion. The example shows simple conversion between upper and lower case plus capitalization and editing of specific words within a text string. Both COBOL programs were written and tested using the VS COBOL II dialect. Also, both COBOL programs will work with COBOL for MVS and COBOL/370. A JCL member is provided to run the job as an MVS batch job on an IBM mainframe or as a project with Micro Focus Mainframe Express (MFE) running on a PC with Windows. Also, a CMD member is provided to run the job with Micro Focus Net Express (MFE) running on a PC with Windows.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Procedure Pointer, External Data Items

This suite of programs will describe how to use procedure pointers and external data items. A procedure pointer will be defined in a primary (or mainline) program. The procedure pointer will then be used to call a secondary program. A linkage section will not be required in the secondary program since the data will be accessed (or shared) using external data items. Both COBOL programs are written using the COBOL/390 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Collating Sequence, EBCDIC & ASCII

This suite of sample programs describes the ASCII and EBCDIC sorting or collating sequences and provides an example of programming logic that will work in an EBCDIC-encoded environment (i.e. Mainframe System with ZOS) but fail in an ASCII-encoded environment (i.e. Linux, UNIX or Windows). The COBOL programs were written using the COBOL/390 dialect and will execute on an IBM Mainframe or the platforms supported by Micro Focus COBOL (i.e. Linux, UNIX or Windows with Micro Focus).

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Copy File with Replacing Function

This suite of sample programs describes how to use the replacing function with a copy file in a COBOL program. The COBOL programs were written using the COBOL/390 dialect and will execute on an IBM Mainframe or the platforms supported by Micro Focus COBOL (i.e. Linux, UNIX or Windows).

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Note: The COBOL language also has an INSPECT REPLACING function that is used to replace characters or text strings within a field at program execution time. For more information about this function refer to the * Text Field, Search and Replace a Text String section of this document.

Table of Contents Previous Section Next Section Replace -INC with Standard Copy

The -INC is supported for the Micro Focus COBOL environment by using the LIBRARIAN"2" compiler directive. However, the CP and Preprocessor technology used with ORACLE requires the -INC to be changed to a standard COPY or EXEC SQL INCLUDE. A global conversion utility program (ALTERINC.CBL) may be used to replace the -INC statements with standard COBOL COPY statements.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data Access Programming Examples

This section contains links or references to programming examples that access various data bases or flat files. The COBOL programs were written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

The examples read existing data sets. Therefore, it will be necessary to create the files or data sets prior to running the examples. To create the data sets refer to the following references.

Table of Contents Previous Section Next Section Creating Simple Test Files

Many of the examples in the SimoTime library use test files. The following suite of programs will create simple test files with 80 byte records. A record sequential file is created and populated using IEBGENR. IDCAMS is then used to define a VSAM cluster. The final program will read the sequential file and populate the VSAM, KSDS.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Alternate Index for VSAM, KSDS

This program suite provides an example of how a COBOL program can process a VSAM, Keyed Sequential Data Set (KSDS) with a primary key and an alternate index. The COBOL programs are written using the COBOL/2 dialect but work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Callable Access, Sequential 80-Byte Records

This program suite provides examples of accessing sequential files with 80-byte records via a simply call to an I/O routine. The COBOL programs are written using the COBOL/2 dialect but work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Comma-Separated-Values or CSV Files

A CSV file is typically an ASCII/Text file with variable length records. The records contain variable-length, concatenated text strings. The text strings (or fields) may be delimited (or separated) by a comma character or a user-defined character.

Table of Contents Previous Section Next Section Create a New CSV File

This suite of sample programs describes how to read a file of fixed field lengths and create a sequential file of variable length records with variable length fields with the leading and trailing spaces removed. The fields are usually separated (or delimited) using a comma between the fields.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Read and Parse an Existing CSV File

This suite of sample programs describes how to read an existing comma-delimited file and create a new column-oriented, fixed-field-length sequential file.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Relational Data Base, Embedded SQL

The following sub-sections are provided as models for creating and managing relational data tables.

Table of Contents Previous Section Next Section Relational Table for Customer Information

This suite of sample programs will show how to create, manipulate and delete a table within a relational data base. This example will create a table containing "customer" information.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Relational Table for Item or Product Information

This suite of sample programs will show how to create, manipulate and delete a table within a relational data base. This example will create a table containing "item" or "product" information.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Generation Data Groups (GDG's)

This suite of sample programs describes how to define a Generation Data Group (GDG). Once the GDG is defined the creation of a Generation Date Set (referred to as a generation or GDS) within the group is discussed. The COBOL program is written using the COBOL/2 dialect but works with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section QSAM Processing Techniques

The following sub-sections describe various alternative processing techniques for QSAM or sequential data files.

Table of Contents Previous Section Next Section Single COBOL Program

This program suite provides an example of how a single COBOL program is used to access a QSAM or Sequential file. The COBOL program is written using the COBOL/2 dialect but also works with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section COBOL with a COBOL I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe COBOL I/O routine to access a QSAM or Sequential file. The I/O routine will also display the file status codes when an I/O error occurs. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section COBOL with an Assembler I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe Assembler I/O routine to access a QSAM sequential file. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370. The assembler IO routine is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section VSAM Processing Techniques

The following sub-sections describe various alternative processing techniques for VSAM Data Sets.

Table of Contents Previous Section Next Section KSDS, Single COBOL Program

This program suite provides an example of how a single COBOL program is used to access a VSAM Key Sequenced Data Set (or KSDS). The COBOL program is written using the COBOL/2 dialect but also works with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section KSDS, COBOL with a COBOL I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe COBOL I/O routine to access a VSAM data set. The I/O routine will also display the file status codes when an I/O error occurs. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section KSDS, COBOL with an Assembler I/O Routine

This program suite provides an example of how a mainline COBOL program calls a mainframe Assembler I/O routine to access a VSAM data set. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370. The assembler IO routine is written in IBM Mainframe Assembler, it will compile using Assembler/H or HLASM.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section ESDS, Create & Add Records, JCL & COBOL

This program suite provides an example of how to delete and define a new Entry Sequenced Data Set (ESDS) using Mainframe JCL. Once the new ESDS is created a COBOL program is used to add records to the data set.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section RRDS, Create & Add Records, JCL & COBOL

This program suite provides an example of how to delete and define a new Relative Record Data Set (RRDS) using Mainframe JCL. Once the new RRDS is created a COBOL program is used to add records to the data set.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data File Processing, Multiple Record Types

This link provides an example of processing a file with multiple record types using COBOL programs. The records contain a combination of text strings and numeric values stored in various formats such as signed-zoned-decimal, packed and binary.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Files with Variable Length Records

The following sub-sections describe various alternative processing techniques for files with variable length records.

Table of Contents Previous Section Next Section Process using Standard COBOL

This program suite provides an example of how to create and access a sequential file containing variable length records using standard SELECT and FD statements. The COBOL programs are written using the COBOL/2 dialect but also works with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Process using Byte-Stream I/O

This program suite provides an example of how to transfer and convert a sequential file containing variable length records. The example includes a description of how to use FTP to download a file without doing a conversion on the Mainframe System. The COBOL programs are written using the Micro Focus dialect and requires Micro Focus Net Express or Micro Focus Mainframe Express.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Variable, Transfer, Share, Convert, Compare

This program suite provides an example of how to Transfer, Share, Convert and Compare record and line sequential files containing variable length records. The example includes a description of how to use FTP to download a file without doing a conversion on the Mainframe System. The COBOL programs are written using the Micro Focus dialect and requires Micro Focus Net Express.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Call SORT from a COBOL Program

This suite of programs will describe and demonstrate by example how to use a COBOL program to call the SORT program to sort the records in a data file in ascending order by the surname that is located in positions 8-22.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Large Micro Focus Files (greater than 2-gig)

This program suite provides an example of how to access large files using Micro Focus COBOL. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data Fields (Edit, Modify & Validate)

This section contains links or references to programming examples that process data at the field level. The COBOL programs were written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

On an EBCDIC or ASCII encoded system each byte is made-up of eight bits. Many of the bytes represent the alphabet, numbers or special characters such as the ampersand or decimal point. The remaining bytes are used for various purposes such as control characters for printing, displaying or transferring data. The COBOL language works with data fields. A field may be a single byte or a string of bytes.

A field may be defined as a text-oriented string of data that contains alpha-numeric values. These fields normally contain values that are printable (i.e. letters, number or special characters). However, this type of field may contain any of the 256 characters. On the mainframe this does not usually cause a serious problem since the print and display managers replace non-printable or non-display values with spaces when the field is moved to the I/O buffer. This can be confusing and a hexadecimal dump of the memory containing the data string would be required to view the actual content. This type of field will be discussed in more detail in the following section about text fields.

A field may be defined as a numeric field that should only contain numeric values. It is possible to get non-numeric values into this type of field and this can cause a serious problem that requires special handling. On the mainframe is an arithmetic operation is attempted on using a numeric field that contains a non-numeric value a program check level 7 will occur. This is also referred to as an S0C7 check (or Sock-Seven check). With Micro Focus this condition will give a 163 error message that states a non-numeric value in a numeric field. Numeric fields come in a variety of different formats that will be discussed in the following section about numeric fields.

Table of Contents Previous Section Next Section Data Fields (Hexadecimal Content)

This section will focus on data fields (or data strings) that may have hexadecimal content that is not alphabetic and numeric values.

Table of Contents Previous Section Next Section Remove Binary Content then Print or Display

This program suite provides an example of a routine that will replace non-display or non-print values with spaces prior to displaying or printing. The example also shows what happens if a display is attempted with the binary or non-display characters in the text string. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data Fields (Text or Alpha-Numeric Content)

This section will focus on data fields (or data strings) that may have alphabetic and numeric content. The various examples will show how the fields are defined and typical processing techniques used with alpha-numeric fields.

Table of Contents Previous Section Next Section Left, Center or Right Justify a Text Field

This suite of programs provides an example of a routine that will center a text string within a field. It also shows how to left or right justify a text string within a field. Two COBOL programs are provided. The first program is a demonstration program that reads a file containing the JUSTIFY information records and calls the second COBOL program that actually does the text justification. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Process Leading & Multiple, Embedded Spaces

This program suite provides an example of how a COBOL program can parse a data string using reference modification. This example will also show how to create a new field (or data string) with the leading spaces removed and the multiple, embedded spaces replaced with a single space. The length of the text within the new field (or data string) is also calculated. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Text Field, Pass, Parse & Convert a Data String

This suite of programs provides examples of how to parse, edit, modify, format and display (standard or hexadecimal dump) various words within a data string. The editing and formatting of a date field are used in this example. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Text Field, Search & Replace a Text String

The objective of this suite of programs is to replace a text string within a field based on a search argument with a text string based on a replacement value of a different length. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Note:The COBOL language also has a REPLACING function that is used to replace text strings in a COBOL copy file at compile time. For more information about this function refer to the * Copy File with Replacing Function section of this document.

Table of Contents Previous Section Next Section Data Fields (Numeric Content)

This section will focus on data fields (or data strings) that have numeric content only. The various examples will show how the fields are defined and typical processing techniques used with numeric fields. The following list provides links to additional SimoTime documents about numeric data fields.

Numeric Tag Description
Zoned Decimal This document describes the zoned-decimal format. This is coded in COBOL as USAGE IS DISPLAY and is the default format if the USAGE clause is missing.
Packed Decimal This document describes the packed-decimal format. This is coded in COBOL as USAGE IS COMPUTATIONAL-3 and is usually coded in its abbreviated form of COMP-3.
Binary This document describes the binary format. This is coded in COBOL as USAGE IS COMPUTATIONAL and is usually coded in its abbreviated form of COMP. This may also be coded with the keyword BINARY.
Edited Numeric This document describes the edited numeric format. This is coded in COBOL using an edit mask in the picture clause. An example would be PIC ZZZ.99+.
spsnum01 This is an introductory, self-study course about the commonly used numeric formats available on the mainframe. The course material may be purchased from SimoTime. The documentation may be viewed on-line.
  How the Numeric Fields are Defined and Typical Processing Techniques (Additional Information)

Table of Contents Previous Section Next Section How to Manage Various Numeric Formats

This example describes some commonly used techniques for managing various numeric formats available on the mainframe and/or included in the specifications for the COBOL programming language.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Right-Adjust and Zero-Fill

This suite of programs provides an example of a routine that will Right-Adjust a text string within a field and fill the left-most or high-order bytes with zeroes. The resulting field is also tested for numeric values and a return code (RA12-RESPOND) is set to zero (0) if numeric and eight (8) if not numeric. Two COBOL programs are provided. The first program is a demonstration program that reads a file containing "RIGHTADJ-info" records and calls the second COBOL program that actually does the right-adjust, zero-fill processing. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Common Formats & Sizes

This suite of example programs will describe the use, format and size of some of the commonly used numeric fields of the COBOL programming language. This example also illustrates how to redefine a numeric field and how to display the actual hexadecimal content of a numeric field. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Testing or Scanning

This program suite provides an example of how a COBOL program can test a numeric field for a numeric value or scan a numeric field using reference modification. An example of doing an arithmetic compare of two numeric values of different numeric formats and size is included. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Printing and Editing

This suite of example programs will describe how to prepare various numeric fields (i.e. packed or COMP-3, binary or COMP and signed, zoned decimal or USAGE IS DISPLAY) for printing. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numbers to Words or Digits to Text

This suite of programs provides an example of how a COBOL program calls a COBOL routine to create a 150-character text data string from a 12-digit numeric field. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Leading Spaces and Zeroes

This suite of example programs (COBOL, JCL and CMD files) will describe the process to compile and execute a COBOL program that is downloaded from a mainframe. The challenge with this program is that it is expected to process the various numeric items in the same manner as the mainframe. For example, a zoned-decimal field that contains leading spaces should not cause an ABEND (i.e. 163 error on Micro Focus) but should treat the leading spaces as zeroes and complete the arithmetic calculation. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Numeric Field, Convert between Formats

This suite of programs provides an example of how to convert between the various numeric formats used with COBOL and on an IBM Mainframe System. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Convert, CSV & Fixed-Field-Length

This suite of programs provides an example of how to convert variable-length, display-oriented numeric values separated by a delimiter character (Comma-Separated-Value) into data strings of a fixed field length format. The fixed field length may be signed or unsigned values in a display, packed or binary format. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data Fields (Bit Processing)

This section will focus on processing data fields (or data strings) at the bit level. The various examples will show how to access the bits within a byte or bits within multiple bytes within a field (or data string). The following list provides links to additional SimoTime documents about bit-level processing.

Note: When doing bit-level processing the results may be different depending on the encoding-schema (i.e. ASCII or EBCDIC) of the system.

Table of Contents Previous Section Next Section Bit Manipulation

Bit manipulation is usually considered something that cannot be done using COBOL. This is an example of how COBOL can do bit-level manipulation. Both COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS, COBOL/370 and Enterprise COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Boolean Logical AND

This suite of programs is provided as a COBOL programming example of one of the possible solutions when performing Boolean logic. This Test Case will perform a logical AND Function.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Boolean Logical OR

This suite of programs is provided as a COBOL programming example of one of the possible solutions when performing Boolean logic. This Test Case will perform a logical OR Function.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Boolean Exclusive OR (XOR)

This suite of programs is provided as a COBOL programming example of one of the possible solutions when performing Boolean logic. This Test Case will perform an Exclusive OR (XOR) Function.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Date Validate, Format and Convert

This is an example of a callable routine that will validate, format or convert dates. The program will accept a Gregorian date in the ccyymmdd, ccyy/mm/dd, ccyy/m/d format then check for numeric values for ccyymmdd. The month and day will also be checked for a valid range of 1-12 and 1-nn according to the month. It also provides conversion to Julian and text. For example, 2001/01/15 will be converted to a Julian date of 2001015 and a text string of January 15, 2001. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Date Calculation, Difference in Days

This is an example of a callable routine that will calculate the difference between two Gregorian dates in the ccyymmdd format. Allowances have been made for leap years with the four-year and four-hundred-year cycles. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Environment, CMD Line & File Names

This is an example of how a COBOL program can access (i.e. Get or Set) environment variables using Micro Focus Net Express. The sample programs start by setting an environment variable for a file name. The program then gets the environment variable and displays the environment value on the screen. Next the program calls a second program that does file I/O. Since the second program is compiled with the SEQUENTIAL(LINE) directive the second program will read the ASCII/Text file specified in the environment value that was set in the first program. The COBOL programs were compiled and executed on a PC using Micro Focus Net Express. The first COBOL program was created using Net Express. The second COBOL program reads a flat, sequential file and was downloaded from the mainframe. The source code was not changed and it was compiled, called and executed on the PC using Micro Focus Net Express.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Data Convert &Transfer Alternatives

This following sub-section will focus on file format and record content conversion techniques and the flow of data in a multiple system environment that includes a Mainframe System, a Linux System, a UNIX System and a Windows System.

Table of Contents Previous Section Next Section Convert, EBCDIC & ASCII, QSAM & VSAM

This following programs show how to convert the organization of a file between sequential and keyed indexed, change the record content between ASCII and EBCDIC or change the record structure by position within a record.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Program Name Description
zap00101 Convert from an EBCDIC-Sequential file to an ASCII-Text file.
zap00201 Convert from an EBCDIC-Sequential file to an ASCII-Indexed file (Sequential-Add).
zap00301 Convert from an EBCDIC-Sequential file to an ASCII-Sequential file.
zap00401 Convert from an ASCII-Text file to an EBCDIC-Indexed file (Sequential-Add).
zap00501 Convert from an ASCII-Text file to an EBCDIC-Indexed file (Random-Add).
  Examples of Various File Format and Record Content Conversion Programs

Note: The preceding five examples are included in the download.

Table of Contents Previous Section Next Section Transfer & Convert, Host to PC to Host

This suite of programs and documentation will discuss the cycle of how to convert a VSAM, KSDS to a flat Sequential file on the mainframe, download the flat sequential file from the mainframe to the PC and create an Indexed file of ASCII content on the PC. Additional programs are included for converting ASCII, Text files to Indexed files. These examples also show how to manage Packed-Decimal and BINARY or COMP fields.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section EBC to ASC, Text String Only

The primary purpose of this suite of job scripts and programs is to describe and demontrate how to convert EBCDIC encoded text string to ASCII encoded text strings. The conversion process may be executed using COBOL or HLASM (High Level Assembler) programs. The first program does the file I/O processing by reading an existing record sequential file, calling a second program to do the record content conversion and writing to a new record sequential file. This document will describe and demonstrate how the conversion process is executed using COBOL programs or HLASM programs that will read an EBCDIC encoded record sequential file and produce an ASCII encoded record sequential file.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section EBC to ASC, Binary, Numeric & Text Strings

This job will execute a program that will read a record sequential, EBCDIC-encoded file, convert or translate the record content and write to a record sequential, ASCII-encoded file while maintaining binary and numeric integrity. The first COBOL program does the file Input and Output and calls a second COBOL program to do the record content conversion between EBCDIC and ASCII. Each record in the Input file is a data structure that contains a mixture of binary, numeric and text strings.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section File Status Codes, Program Access

This COBOL programming example will show how to display the file status code by converting the two byte file status code that may contain binary data to a four byte numeric value. This example contains two COBOL programs. The first is a demonstration program that generates various two byte, file status codes. The second COBOL routine does the actual conversion to a four byte, numeric value that may be displayed. A brief description of the file status code is also provided. Sample mainframe JCL and a sample COBOL program are included.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Floating Point Arithmetic

This suite of sample programs provides an example of a COBOL program doing floating point arithmetic and writing the information to a Sequential file. Sample mainframe JCL and a sample COBOL program are included.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Internal Reader (INTRDR), Submit Job

This suite of programs will describe how to submit a second job to the internal reader from within the currently running job using a COBOL program. The second job simply executes IEFBR14 with a return to the caller.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Read KSDS, Sort & Print Mailing Labels

This suite of programs provides an example of how a mainline application processes a VSAM, KSDS or Indexed File containing Name, Address information and creates a sorted (by postal code sequence) sequential file containing mailing labels that are formatted with 1, 2, 3 or 4 labels across of six lines for each label. This example uses a two-dimensional array to build the label-printing output. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Micro Focus Environment

This section describes the documents and examples that are unique to a Micro Focus Development, Test or Production environment.

Table of Contents Previous Section Next Section Compiler Directives

Compiler directives may be individually specified in the source code of a COBOL program, as part of a Net Express project or grouped together in a directives file that may be referenced by the project or command that is doing the compile. For most of the compiles this suite of examples uses directives files, two for the batch environment and two for the online environment. The following sections describe each in more detail.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Scripted Application Build

Many shops now require a scripted build process of creating the load members for the production version of an application. This process needs to be an automated process that runs without operator intervention and produces documentation of the results.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Compiler or Link For INT, GNT or EXE

This document will describe the process for creating executable members from COBOL source members. The process uses Job Scipts or Batch Job Processing techniques to create INT, GNT or EXE executables. This process was originally created and executed using Microsoft Windows 2000 Professional with Micro Focus Net Express 3.0 and 3.1.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Callable WAIT Function

When a job is submitted to a JES Region (or Server Instance) 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.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section JOB Query of JCL from COBOL

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. This suite of programs requires a Windows System with Micro Focus Enterprise Server.

Review the Documentation for this suite of program members.

Note:  For additional information about the SimoTime Job Query program please contact the helpdesk@simotime.com

Table of Contents Previous Section Next Section Parameter Passing from JCL

This program suite provides an example of how a COBOL program accesses and processes a data string specified as a parameter as part of the EXEC statement in the JCL that is running the job. The COBOL program is written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Street Address Parse, Edit & Format

This program suite provides an example of how a COBOL program can parse a data string containing a street address and produce a new data string with an edited street address (i.e. case formatting and word substitution). The program also identifies a Post Office Box address. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Stub or Model Program

This suite of programs provides a stub or starter program for 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

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Table Processing

This section provides information about table processing within a COBOL program. The sample programs provide a variety of table processing techniques.

Table of Contents Previous Section Next Section Define, Load, Search & Sort a Table

This program suite describes how to define, load, search (Linear or Binary) and sort a table using standard COBOL or custom written search routines. The COBOL programs are written using the COBOL/390 dialect but also work with Enterprise COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Bubble Sort for Table

This suite of sample programs describes how to use COBOL to load a table with customer information and then sort the table using a bubble sort routine. The elements in the table will be sorted in postal code sequence.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Create or Define a Table of Binary Values

This suite of sample programs describes how to use COBOL to create a table of binary values from X'00' through X'FF'. The COBOL programs are written using the COBOL/390 dialect but also work with Enterprise COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Tips & Techniques for COBOL

This program suite describes how to define, load, search (Linear or Binary) and sort a table using standard COBOL or custom written search routines. The COBOL programs are written using the COBOL/390 dialect but also work with Enterprise COBOL.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Diagnostic Aids

This section provides documentation and examples of programs that may be used to assist in a program debugging effort in a development environment or to track the results of program execution in a development or production environment.

Table of Contents Previous Section Next Section SYSOUT to Console or File

This suite of programs are used to test and demonstrate the functions provided by the SIMOLOGS callable routine. A simple call with a request code will display a message to the User-Defined SYSOUT device, Display a message to the System Operator Console or Write a message to a User-Defined Log file.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hexadecimal Notation

This sub-section contains examples of how to process hexadecimal data using COBOL. The ability to convert a text string or a record within a file to its hexadecimal value and display the information can be quite useful when debugging a program. The ability to write the information to a log file can be useful when trying to isolate an intermittent problem. The examples provide two hexadecimal dump formats, The first is primarily for data strings and the second is for records within a file. Examples of the dump formats are included in the following programs. The programs also have the capability of performing in an ASCII or EBCDIC environment.

Table of Contents Previous Section Next Section STPEEK01, Peek at a Memory Segment

The STPEEKC1 routine (or called program) will access a user defined binary string of data and create a text string of data in a hex-decimal notation format that may be displayed or used in a review process that involves human observation.

For additional information about this utility program refer to the stpeek01.htm document.

For a test case that describes and demonstrates how to use this utility program refer to the tcpeek01.htm document.

Table of Contents Previous Section Next Section Embedded Hex Characters in Source Code

This suite of programs provides an example of how to identify and process embedded hexadecimal or non-printable characters in a text string or field. The COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump of Fields or Data Items

This suite of programs provides a demonstration program and a callable program to display a data string in a hexadecimal format for both EBCDIC and ASCII. Both COBOL programs are written using the COBOL/2 dialect but also work with COBOL for MVS and COBOL/370.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump of Storage or Memory

This suite of programs and documentation will describle and demonstrate how to convert a memory-resident data string of one-byte items to a text string of two-byte items using hexadecimal notation. The hexadecimal notation string is then posted to the SYSOUT device.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump of Sequential Files

This suite of sample programs describes Sequential File I/O and HEX-Dump formatting. The programs describe how to dump the input records to an output file in Hexadecimal format. This suite of programs will run on a Personal Computer with Windows and Micro Focus COBOL. The use of the EXTFHTAB.CFG file is used to override the Micro Focus default that replaces TAB characters with SPACE characters. The COBOL programs are compiled with the ASSIGN(EXTERNAL) and the SEQUENTIAL(LINE) directives. The former provides for external file mapping of file names. The latter provides for the mapping of the SEQUENTIAL files specified in the COBOL program to LINE SEQUENTIAL (or ASCII/TEXT) files. This technique provides for the use of a single COBOL source program that uses standard COBOL/2 dialect for sequential file processing.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump of VSAM Data Set

This is an interesting program that would have required an assembler routine prior to the introduction of COBOL/2 for the mainframe. This program reads a VSAM, Keyed-Sequential-Data-Set (KSDS) and writes a sequential (QSAM) file that contains hexadecimal information.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump of Customer Master

This is an interesting set of programs that would have typically been created using an assembler routine prior to the introduction of COBOL/2 for the mainframe. The following programs that read a VSAM, KSDS and write hexadecimal dump information to a sequential file were generated using SimoTime Technologies. The 1st example uses a primary program that reads the Customer Master and calls a 2nd program to write the hex-dump information to a sequential file. The 2nd example generates a single COBOL that does the file I-O and hex-dump formatting. This single COBOL program is ANSI/85 compliant and may be transferred, compiled and executed on a variety of platforms.

Table of Contents Previous Section Next Section Hex-Dump, COBOL calling COBOL

This set of programs will read the Customer Master File that is a VSAM, Keyed-Sequential-Data-Set (KSDS) and write to a variable-length, sequential file that contains hexadecimal information. Records to be written to the Hex-Dump file are selected based on a list of primary keys in a control file.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Hex-Dump, Single COBOL Program

This program reads the Customer Master File that is a VSAM, Keyed-Sequential-Data-Set (KSDS) and writes to a user-defined sequential file that contains hexadecimal information. Records to be written to the Hex-Dump file are selected based on a list of primary keys in a control file. The hex-dump formatting and file I-O are done within a single COBOL program that is generated by SimoTime Technologies.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Snap Dump of Working Storage

This example illustrates the use of a callable routine that does a snap memory dump for a linear area of memory. Its primary purpose is to dump the working storage section of a program but may be used to dump other areas of memory or partial areas of working storage.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section ABEND, Micro Focus Environment

This section will focus on the Micro Focus Environment and provides documentation and examples of programs that may be used to assist in a program debugging effort in a development environment or to track the results of program execution in a development or production environment.

Table of Contents Previous Section Next Section ABEND, User Terminates Program Execution

This suite of sample programs describes how to call an ABEND (ABnormal ENDing) routine in a Micro Focus environment. This routine will display the call stack starting with the program that called the ABEND routine.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section ABEND, Problem Determination, Job Restart

This suite of programs (COBOL and JCL) will describe and demonstrate the Job Restart capabilities that are available in Micro Focus Enterprise Server. Also, this suite of programs includes a description and demonstration of the diagnostic capabilities for the CORE_ON_ERROR function of Micro Focus Enterprise Server.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section ABEND, RTS0114, CORE_ON_ERROR

This suite of programs will describe and demonstrate how to produce an RTS0114 ABEND and show the problem determination and program debugging capabilities for the CORE_ON_ERROR function of Micro Focus Enterprise Server.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Program Tracking and Elapsed Time

This suite of programs is used at execution time to track program execution points of interest with the current time and the elapsed times since the prior call and the first call. The information is written to SYSOUT in a Comma-Delimited-Values (or CSV) format and may be easily imported into an excel spread sheet.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Compare Directory Content

The Directory Compare Utility Program may be used to compare the contents of two different directories or to compare the contents of the same directory before and after a job has executed.

Review the Documentation for this suite of program members. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Table of Contents Previous Section Next Section Java and COBOL

This section contains information about COBOL and Java working together as complementary technologies.

Table of Contents Previous Section Next Section Java, COBOL and Micro Focus

A fifteen (15) day "Discovery-Session and Proof-of-Concept" project was completed by SimoTime Enterprises during December, 2001. The objective of this project was to determine the practicality of using existing COBOL programs or parts of programs to backend an Internet frontend written in Java. This project used the Java Development Kit (JDK) from Sun Micro systems, Micro Focus Net Express for the COBOL and a Lite Web Server from Gefion Software.

Review the Documentation for this suite of program members.

Table of Contents Previous Section Next Section Summary

The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers that are interested in the COBOL programming language. Links to additional documents and programming examples are provided.

Link to Internet   Link to Server   Link to additional Contact Information for SIMOTIME Technologies and Services. SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. SIMOTIME Technologies are used to support the services projects.

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.

Note: The latest versions of the SimoTime Documents and Program Suites are available on the Internet and may be accessed using the Link to Internet icon. If a user has a SimoTime Enterprise License the Documents and Program Suites may be available on a local server and accessed using the Link to Server icon.

Link to Internet   Link to Server   Explore An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore How to Document Record Layouts or other Data Structures using a COBOL copy file. For reference or documentation purposes SimoREC1 creates an ASCII/Text file and an HTML document from a COBOL copy file. The utility provides the length of a field and the position of the start of the field within a record. Also, the actual physical length for group items, packed fields, binary fields and tables will be calculated.

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 JCL Connection for more examples of JCL functionality with programming techniques and sample code.

Link to Internet   Link to Server   Explore Documents and Examples that Describe or Show many of the Details Involved with Application or Data Migration and the moving of an application between platforms such as a Mainframe System running ZOS and a Linux, UNIX or Windows (LUW) System running Micro Focus Enterprise Server.

Link to Internet   Link to Server   Explore the SQL Connection for more examples of how to create, manipulate and delete Relational Data Bases. The COBOL programs are written to compile and execute on a Windows System with SQL Server and Micro Focus Enterprise Server or an IBM Mainframe System with DB2.

Link to Internet   Link to Server   Explore the non-Relational Data Connection for more examples of accessing methodologies and coding techniques for Data Files and VSAM Data Sets.

Link to Internet   Link to Server   Explore the Numbers Connection for additional information about the structure and processing of numeric data items (or numeric fields).

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.

Explore the GnuCOBOL Technologies available from SourceForge. SourceForge is an Open Source community resource dedicated to helping open source projects be as successful as possible. GnuCOBOL (formerly OpenCOBOL) is a COBOL compiler with run time support. The compiler (cobc) translates COBOL source to executable using intermediate C, designated C compiler and linker. This link will require 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
The COBOL Connection, Examples and Reference Material
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com