Eighty-Column Card Files
When technology complements business   COBOL Example, Read and Write
Copyright © 1987-2008  SimoTime Enterprises, LLC  All Rights Reserved  http://www.simotime.com

 
Introduction Version 06.10.30
 
  Programming Objectives
  Programming Input and Output
  Programming Requirements
  Programming Overview
  CMD for Execution with Net Express and Windows
 
  Read ASCII/Text and Write EBCDIC-encoded Record Sequential
  Read EBCDIC-encoded Record Sequential and Write ASCII/Text
  Compare Two ASCII/Text Files
  Multi-Step Job, Converts and Compare
  Setting Environment Variables
  The COBOL Demonstration Program
 
  Read ASCII/Text and Write EBCDIC-encoded Record Sequential
  Read EBCDIC-encoded Record Sequential and Write ASCII/Text
  Compare Two ASCII/Text Files
  Summary
 
  Software Agreement and Disclaimer
  Downloads and Links to Similar Pages
  Glossary of Terms
  Comments or Suggestions
  About SimoTime

Introduction
(Next) (Previous) (Table-of-Contents)

On the mainframe it is a common practice to read a sequential file of eighty (80) byte records to obtain information or specifications that will affect the behavior of program execution. The eighty (80) byte records are a carry-over from the days when eighty-column cards were used. Even today these files are referred to as card files.

The technique for accessing these files varies and this suite of sample programs describes a few of the possible techniques. In addition, when an application is moved between an EBCDIC-encoded Mainframe environment and a Windows or UNIX platform it may be converted to run in an ASCII-encoded environment and this introduces a new set of challenges.

This suite of programs and documentation describes the techniques for simplifying this process by using callable I/O modules and a callable conversion routine that are provided by  The SimoCARD Series  of programs. The I/O modules provide for read and write access of both record and line sequential files The conversion routine will convert 80-byte text strings between EBCDIC-encoding and ASCII-encoding.

Programming Objectives
(Next) (Previous) (Table-of-Contents)

At this point it is important to note the terminology used in this document. The term "Record Sequential" will be used to refer to a sequential file that contains fixed-length records concatenated one after the other without record separators. This type of file may contain ASCII or EBCDIC encoded data along with numeric fields of various mainframe (or COBOL) formats such as packed or binary (i.e. COMP-3 or COMP).

The term "Line Sequential" (or ASCII/Text file) will be used to refer to a sequential file that contains variable-length records concatenated one after the other with a record separator inserted between each record. For Windows the record separator is two bytes (i.e. a carriage return and a line feed or a x'0D0A'). For UNIX the record separator is a single line feed character or x'0A'. To add to the confusion for an Apple Mac the record separator is a single carriage return character or x'0D'.

The primary purpose of this suite of programs is to address some of the possibilities and considerations when sharing or migrating data between an EBCDIC-encoded IBM Mainframe system (Note: the IBM, AS/400 is an EBCDIC-encoded system) and an ASCII-encoded Windows or UNIX system. This example will focus on sequential files with eighty (80) byte records.

This examples illustrate the following functions.

1. Demonstrate how to read or write from and to a file (Record or Line Sequential) by calling an I/O routine..
2. Demonstrate how to do file format conversions between variable-length records and fixed-length records.
3. Demonstrate how to do file content conversions between ASCII and EBCDIC encoded text strings.
4. Demonstrate how to compare two data files using a generated COBOL program.

Programming Input and Output
(Next) (Previous) (Table-of-Contents)

The following records are included in an ASCII/Text (or Line Sequential) file. This file (TEST0080.TXT) will be converted to an EBCDIC-encoded, Record Sequential file with eighty (80) byte, fixed length records. The EBCDIC-encoded file will then be converted back to a third file that is an ASCII/Text file. The two ASCII/Text files will then be compared using a generated COBOL program. They should be identical.

000000000001 A 
000000000002 AB 
000000000003 ABC 
000000000004 ABCD 
000000000005 ABCDE 
000000000006 ABCDEF 
000000000007 ABCDEFG 
000000000008 ABCDEFGH 
000000000009 ABCDEFGHI 
000000000010 ABCDEFGHIJ 
000000000011 ABCDEFGHIJK 
000000000012 ABCDEFGHIJKL 
000000000013 ABCDEFGHIJKLM 
000000000014 ABCDEFGHIJKLMN 
000000000015 ABCDEFGHIJKLMNO 
000000000016 ABCDEFGHIJKLMNOP 
000000000017 ABCDEFGHIJKLMNOPR 
000000000018 ABCDEFGHIJKLMNOPQR 
000000000019 ABCDEFGHIJKLMNOPQRS 
000000000020 ABCDEFGHIJKLMNOPQRST 
000000000021 ABCDEFGHIJKLMNOPQRSTU 
000000000022 ABCDEFGHIJKLMNOPQRSTUV 
000000000023 ABCDEFGHIJKLMNOPQRSTUVW 
000000000024 ABCDEFGHIJKLMNOPQRSTUVWX 
000000000025 ABCDEFGHIJKLMNOPQRSTUVWXY 
000000000026 ABCDEFGHIJKLMNOPQRSTUVWXYZ 
000000000027 ABCDEFGHIJKLMNOPQRSTUVWZXZabcdefghijklmnopqrstuvwxtz1234567890 
000000000028 ABCDEFGHIJKLMNOPQRSTUVWXYZ 
000000000029 ABCDEFGHIJKLMNOPQRSTUVWXY 
000000000030 ABCDEFGHIJKLMNOPQRSTUVWX 
000000000031 ABCDEFGHIJKLMNOPQRSTUVW 
000000000032 ABCDEFGHIJKLMNOPQRSTUV 
000000000033 ABCDEFGHIJKLMNOPQRSTU 
000000000034 ABCDEFGHIJKLMNOPQRST 
000000000035 ABCDEFGHIJKLMNOPQRS 
000000000036 ABCDEFGHIJKLMNOPQR 
000000000037 ABCDEFGHIJKLMNOPQ 
000000000038 ABCDEFGHIJKLMNOR 
000000000039 ABCDEFGHIJKLMNO 
000000000040 ABCDEFGHIJKLMN 
000000000041 ABCDEFGHIJKLM 
000000000042 ABCDEFGHIJKL 
000000000043 ABCDEFGHIJK 
000000000044 ABCDEFGHIJ 
000000000045 ABCDEFGHI 
000000000046 ABCDEFGH 
000000000047 ABCDEFG 
000000000048 ABCDEF 
000000000049 ABCDE 
000000000050 ABCD 
000000000051 ABC 
000000000052 AB 
000000000053 A 

Programming Requirements
(Next) (Previous) (Table-of-Contents)

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

1. Executes on Windows/NT or Windows/XP using Micro Focus Mainframe Express and the JCL file provided.
2. Executes on Windows/NT or Windows/XP using Micro Focus Net Express and the CMD file provided.
3. May be ported to run on the UNIX platforms supported by Micro Focus COBOL.

The sample programs in the suite of programs will make calls to programs that are provided in the SimoMODS and SimoCARD Series of programs. Therefore, the basic SimoLIBR should be installed.

Programming Overview
(Next) (Previous) (Table-of-Contents)

The following is a flowchart of the job for executing the program to reads an ASCII/Text file of variable length records and creates an EBCDIC-encoded record sequential file of eighty (80) byte fixed length records.

The following is a block diagram of the Digits-to-Text application demonstration. The RED boxes are unique to the PC with Windows and Micro Focus Net Express. The GREEN boxes are portable across platforms supported by Micro Focus COBOL. Since many of the programs in this example access "LINE SEQUENTIAL" files they will not compile and execute on a mainframe system.

   
CBLCRDE1
cmd
          The JCL or CMD member for running the application.
   
 
           
   
IF Exist
stmt
          Delete any previously created files.
   
 
           
   
CBLCRDC1
CBL
          Read ASCII/Text and Write EBCDIC fixed length.
     
     
     
     
     
     
     
     
     
     
     
     
     
     
call    
       
     
     
     
 
GET080LS
data
     
     
     
SIMOGL80
CBL
      Read an ASCII/Text File.
     
     
     
     
     
call    
     
     
     
     
     
     
     
     
     
       
     
     
     
     
SIMOXT80
CBL
      Convert between ASCII and EBCDIC..
     
     
     
     
     
call    
     
     
     
     
     
     
     
     
     
       
     
     
     
     
SIMOPR80
CBL
     
     
     
PUT080RS
data
  Write to a Record Sequential File
     
     
     
     
     
     
     
     
     
           
   
End-of-Job
EOJ
          End of Job
                 

The main program (CBLCRDC1) contains no File I/O coding or conversion coding, it simply calls the I/O routines and the conversion routine to do the detailed work. The source code for the CMD file and the COBOL programs is provided and may be modified to fit your environment. The I/O and conversion routines are part of the  SimoCARD Series  of programs

CMD for Execution with Net Express and Windows
(Next) (Previous) (Table-of-Contents)

This section describes the command files that are provided in the suite of programs.

Command Description
CBLCRDE1  This command file (or Job Script) will execute a program that will read an ASCII-encoded, text file with variable length records and write to an EBCDIC-encoded file with eighty (80) byte, fixed length records.
CBLCRDE2  This command file (or Job Script) will execute a program that will read an EBCDIC-encoded file with eighty (80) byte, fixed length records and write to an ASCII-encoded, text file with variable length records.
CBLCRDE3  This command file (or Job Script) will execute a program that will compare the contents of the two ASCII-encoded text files.
CBLCRDE9  This command file (or Job Script) that does the three preceding jobs as steps within a multi-step job.
Env1PROD  This command file (or Job Script) will set the commonly used environment variables. The use of a callable command file provides a single point of definition and reuse.

CMD, Read ASCII/Text and Write EBCDIC Record Sequential
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDE1.CMD) is a Windows .CMD that will execute a program that will read an ASCII-encoded, text file with variable length records and write to an EBCDIC-encoded file with eighty (80) byte, fixed length records.

@echo OFF
rem  * *******************************************************************
rem  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2007 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Read ASCII Text and write EBCDIC fixed record file
rem  * Author  - SimoTime Enterprises
rem  * Date    - November 11, 2003
rem  * Version - 03.12.15
rem  *
rem  * This set of programs illustrates the use of some of the commonly
rem  * called I/O routines that will read or write 80 byte records from
rem  * or to s record sequential or line sequential file. In this example
rem  * the text string will be converted from ASCII to EBCDIC before
rem  * writing to the EBCDIC-encoded file with eighty (80) byte, fixed
rem  * length records.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express or Mainframe Express.
rem  *
rem  *   ************
rem  *   * CBLCRDE1 *
rem  *   ********cmd*
rem  *        *
rem  *   ************     ************      **********
rem  *   * SIMOEXEC ******* CBLCRDC1 *<=====* Tag==A *
rem  *   ********exe*     ********dll*      **********
rem  *      *                 *
rem  *      *                 *
rem  *      *                 **call************
rem  *      *                 *                *
rem  *      *                 *                *
rem  *      *     *************                *
rem  *      *     *                            *
rem  *      *     *                            *
rem  *      *     *     ************     ************
rem  *      *     *     * GET080LS ******* SIMOGL80 *  Read 80 bytes
rem  *      *     *     *******data*     ********dll*
rem  *      *     *
rem  *      *     *
rem  *      *     ***call***********************
rem  *      *     *                            *
rem  *      *     *                      ************
rem  *      *     *                      * SIMOXT80 *  Convert ASCII/EBCDIC
rem  *      *     *                      ********dll*
rem  *      *     *
rem  *      *     *
rem  *      *     ***call***********************
rem  *      *     *                            *
rem  *      *     *                      ************     ************
rem  *      *     *      Write 80 bytes  * SIMOPR80 ******* PUT080RS *
rem  *      *     *                      ********dll*     *******data*
rem  *      *     *
rem  *      *     *      ********        **********
rem  *      *     ******** EOF? ****no**** Goto=A *=====>
rem  *      *            ********        **********
rem  *      *                *
rem  *      *                *
rem  *      *************yes**
rem  *      *
rem  *   ************
rem  *   *   EOJ    *
rem  *   ************
rem  *
rem  * *******************************************************************
rem  * Step   1 of 2  Set the global environment variables...
rem  *
     setlocal
     call Env1PROD
     call SimoNOTE "*******************************************************CblCrdE1"
     call SimoNOTE "Starting JobName CblCrdE1"
     set GET080LS=%BaseLib1%\DataTxt1\AlphaBETLseqAscMaxRec80.TXT
     set PUT080RS=%BaseLib1%\DataWrk1\AlphaBETRseqEbcFixRec80.DAT
rem  * *******************************************************************
rem  * Step 1 of 1  Read ASCII-Line Sequential, write EBCDIC-Record-Sequential
rem  *
     if  exist %PUT080RS% erase %PUT080RS%
     SimoEXEC EXEC CblCrdC1
     if ERRORLEVEL = 0 goto :EojAOK
     set JobStatus=0010
     goto :EojNOK
rem  *
:EojNOK
     call SimoNOTE "ABENDING JobName CblCrdE1, Status is %JobStatus%"
     goto :End
rem  *
:EojAOK
     call SimoNOTE "Complete JobName CblCrdE1, Status is %JobStatus%"
     goto :End
rem  *
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause
     endlocal

CMD, Read EBCDIC Record Sequential and Write ASCII/Text
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDE2.CMD) is a Windows .CMD that will execute a program that will read an EBCDIC-encoded file with eighty (80) byte, fixed length records and write to an ASCII-encoded, text file with variable length records.

@echo OFF
rem  * *******************************************************************
rem  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2007 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Read ASCII Text and write EBCDIC fixed record file
rem  * Author  - SimoTime Enterprises
rem  * Date    - November 11, 2003
rem  * Version - 03.12.15
rem  *
rem  * This set of programs illustrates the use of some of the commonly
rem  * called I/O routines that will read or write 80 byte records from
rem  * or to s record sequential or line sequential file. In this example
rem  * the text string will be converted from ASCII to EBCDIC before
rem  * writing to the EBCDIC-encoded file with eighty (80) byte, fixed
rem  * length records.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express or Mainframe Express.
rem  *
rem  *   ************
rem  *   * CBLCRDE2 *
rem  *   ********cmd*
rem  *        *
rem  *   ************     ************
rem  *   * SIMOEXEC ******* CBLCRDC2 *
rem  *   ********exe*     ********dll*
rem  *      *                 *
rem  *      *                 *
rem  *      *                 **call************
rem  *      *                 *                *
rem  *      *                 *                *
rem  *      *     *************                *
rem  *      *     *                            *
rem  *      *     *                            *
rem  *      *     *     ************     ************
rem  *      *     *     * GET080RS ******* SIMOGR80 *  Read 80 bytes
rem  *      *     *     *******data*     ********dll*
rem  *      *     *
rem  *      *     *
rem  *      *     ***call***********************
rem  *      *     *                            *
rem  *      *     *                      ************
rem  *      *     *                      * SIMOXT80 *  Convert EBCDIC/ASCII
rem  *      *     *                      ********dll*
rem  *      *     *
rem  *      *     *
rem  *      *     ***call***********************
rem  *      *                                  *
rem  *      *                            ************     ************
rem  *      *            Write 80 bytes  * SIMOPL80 ******* PUT080LS *
rem  *      *                            ********dll*     *******data*
rem  *   ************
rem  *   *   EOJ    *
rem  *   ************
rem  *
rem  * *******************************************************************
rem  * Set the environment variables...
rem  *
     setlocal
     call Env1PROD
     call SimoNOTE "*******************************************************CblCrdE2"
     call SimoNOTE "Starting JobName CblCrdE2"
     set GET080RS=%BaseLib1%\DataWrk1\AlphaBETRseqEbcFixRec80.DAT
     set PUT080LS=%BaseLib1%\DataWrk1\AlphaBETLseqAscVarRec8002.TXT
     set SYSOUT=%BaseLib1%\logs\SysOutCblCrd.TXT
rem  * *******************************************************************
rem  * Step 1 of 1  Read EBCDIC-Record-Sequential, write ASCII-Line-Sequential
rem  *
     if  exist %PUT080LS% erase %PUT080LS%
     SimoEXEC EXEC CblCrdC2
     if ERRORLEVEL = 0 goto :EojAOK
     set JobStatus=0020
     goto :EojNOK
rem  *
:EojNOK
     call SimoNOTE "ABENDING JobName CblCrdE2, Status is %JobStatus%"
     goto :End
rem  *
:EojAOK
     call SimoNOTE "Complete JobName CblCrdE2, Status is %JobStatus%"
     goto :End
rem  *
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause
     endlocal

CMD, Compare Two ASCII/Text
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDE3.CMD) is a Windows .CMD that will execute a program that will compare the contents of the two ASCII-encoded text files.

@echo OFF
rem  * *******************************************************************
rem  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2007 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Compare ACTUAL80 with EXPECT80, ASCII/Text Files
rem  * Author  - SimoTime Enterprises
rem  * Date    - November 11, 2003
rem  * Version - 03.12.15
rem  *
rem  * This set of programs illustrates the use of a COBOL program to
rem  * compare two ASCII/Text files with a maximum record length of
rem  * eighty (80) bytes.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express.
rem  *
rem  * *******************************************************************
rem  * Set the environment variables...
rem  *
     setlocal
     call Env1PROD
     call SimoNOTE "*******************************************************CblCrdE3"
     call SimoNOTE "Starting JobName CblCrdE3"
     set EXPECT80=%BaseLib1%\DataTxt1\AlphaBETLseqAscMaxRec80.TXT
     set ACTUAL80=%BaseLib1%\DataWrk1\AlphaBETLseqAscVarRec8002.TXT
     set SYSUT3=%BaseLib1%\DataTxt1\SYSUT3X1.TXT
     set SYSOUT=%BaseLib1%\logs\SysOutCblCrd.TXT
rem  * *******************************************************************
rem  * Step 1 of 1  Compare the ASCII/Text files
rem  *
     SimoEXEC EXEC CblCrdC3
     if ERRORLEVEL = 0 goto :EojAOK
     set JobStatus=0030
     goto :EojNOK
rem  *
:EojNOK
     call SimoNOTE "ABENDING JobName CblCrdE3, Status is %JobStatus%"
     goto :End
rem  *
:EojAOK
     call SimoNOTE "Complete JobName CblCrdE3, Status is %JobStatus%"
     goto :End
rem  *
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause
     endlocal

CMD, Multi-Step Job, Converts and Compare
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDE9.CMD) is a Windows .CMD that does the three preceding jobs as steps within a multi-step job.

@echo OFF
rem  * *******************************************************************
rem  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2006 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Read ASCII Text and write EBCDIC fixed record file
rem  * Author  - SimoTime Enterprises
rem  * Date    - November 11, 2003
rem  * Version - 03.12.15
rem  *
rem  * This set of programs illustrates the use of some of the commonly
rem  * called I/O routines that will read or write 80 byte records from
rem  * or to s record sequential or line sequential file. In this example
rem  * the text string will be converted from ASCII to EBCDIC before
rem  * writing to the EBCDIC-encoded file with eighty (80) byte, fixed
rem  * length records.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express or Mainframe Express.
rem  *
rem  * *******************************************************************
rem  * Set the Environment
rem  *
     setlocal
     call Env1PROD
     call SimoNOTE "*******************************************************CblCrdE9"
rem  *
rem  * *******************************************************************
rem  * Step 1 of 3  Read ASCII-Line-Sequential, write EBCDIC-Record-Sequential
:Step01
     call SimoNOTE "Starting JobName CblCrdE9, Step01"
     set GET080LS=%BaseLib1%\DataTxt1\AlphaBETLseqAscMaxRec80.TXT
     set PUT080RS=%BaseLib1%\DataWrk1\AlphaBETRseqEbcFixRec80.DAT
     set SYSOUT=%BaseLib1%\logs\SysOutCblCrd.TXT
rem  *
     if  exist %PUT080RS% erase %PUT080RS%
     SimoEXEC EXEC CblCrdC1
     if ERRORLEVEL = 0 goto :Step02
     set JobStatus=0010
     goto :EojNOK
rem  *
rem  * *******************************************************************
rem  * Step 2 of 3  Read EBCDIC-Record-Sequential, write ASCII-Line-Sequential
:Step02
     call SimoNOTE "Starting JobName CblCrdE9, Step02"
     set GET080RS=%BaseLib1%\DataWrk1\AlphaBETRseqEbcFixRec80.DAT
     set PUT080LS=%BaseLib1%\DataWrk1\AlphaBETLseqAscVarRec8002.TXT
     set SYSOUT=%BaseLib1%\logs\SysOutCblCrd.TXT
rem  *
     if  exist %PUT080LS% erase %PUT080LS%
     SimoEXEC EXEC CblCrdC2
     if ERRORLEVEL = 0 goto :Step03
     set JobStatus=0020
     goto :EojNOK
rem  *
rem  * *******************************************************************
rem  * Step 3 of 3  Compare the ASCII-Line-Sequential files
:Step03
     call SimoNOTE "Starting JobName CblCrdE9, Step03"
     set EXPECT80=%BaseLib1%\DataTxt1\AlphaBETLseqAscMaxRec80.TXT
     set ACTUAL80=%BaseLib1%\DataWrk1\AlphaBETLseqAscVarRec8002.TXT
     set SYSUT3=%BaseLib1%\DataTxt1\SYSUT3X1.TXT
     set SYSOUT=%BaseLib1%\logs\SysOutCblCrd.TXT
rem  *
     SimoEXEC EXEC CblCrdC3
     if ERRORLEVEL = 0 goto :EojAOK
     set JobStatus=0030
     goto :EojNOK
:EojNOK
     call SimoNOTE "ABENDING JobName CblCrdE9, Status is %JobStatus%"
     goto :End
rem  *
:EojAOK
     call SimoNOTE "Complete JobName CblCrdE9, Status is %JobStatus%"
     goto :End
rem  *
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause
     endlocal

CMD, Setting Environment Variables
(Next) (Previous) (Table-of-Contents)

The following (Env1PROD.CMD) is the Windows .CMD that is used to set the common environment variables used by the jobs included in this example.

@echo off
rem  * *******************************************************************
rem  *                   This program is provided by:                    *
rem  *                    SimoTime Enterprises, LLC                      *
rem  *           (C) Copyright 1987-2006 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Provide a single point to set common environment variables.
rem  * Author - SimoTime Enterprises
rem  * Date   - January 24, 1996
rem  *
rem  * Set the commonly used environment variables. This is used to provide
rem  * a single point for managing the commonly used environment variables.
rem  *
     set BaseLib1=c:\Assist01\WIN1
     set syslog=%BaseLib1%\LOGS\SimLog.TXT
     set SimoNOTE=%BaseLib1%\LOGS\SimLog.TXT
     call SimoNOTE "Starting JobName Env1PROD.CMD"
     set sysout=%BaseLib1%\LOGS\ApplOut.TXT
     set SysTRAK=%BaseLib1%\LOGS\SYSTRAK1.TXT
rem  *
     set path=C:\Program Files\Micro Focus\Net Express 5.0\Base;C:\Program Files\Micro Focus\Net Express 5.0\Base\bin;%path%
rem  *
     set JobStatus=0000
     call SimoNOTE "Finished JobName Env1PROD.CMD"

The COBOL Demonstration Program
(Next) (Previous) (Table-of-Contents)

This section provides detailed information about the COBOL programs used in this suite of sample programs.

COBOL, Read ASCII/Text and Write EBCDIC Record Sequential
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDC1.CBL) is a sample of the COBOL program that will read an ASCII-encoded, text file with variable length records and write to an EBCDIC-encoded file with eighty (80) byte, fixed length records.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBDCRDC1.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      * Copyright (C) 1987-2006 SimoTime Enterprises, LLC.            *
      *                                                               *
      * 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 commercial purpose requires a fee to be paid to       *
      * SimoTime Enterprises. 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           *
      * Enterprises.                                                  *
      *                                                               *
      * Permission to use, copy and modify 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           *
      * Enterprises.                                                  *
      *                                                               *
      * SimoTime Enterprises makes no warranty or representations     *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any express or implied warranty,     *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Enterprises 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 Enterprises                                          *
      * 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 Enterprises,  *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Enterprises         *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * MAINTENANCE
      * -----------
      * 1994/02/27 Simmons, Created program.
      *
      *****************************************************************
      * Source Member: CBDCRDC1.CBL
      * Copy Files:    PASSGL80
      *
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *****************************************************************
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CBDCRDC1 '.
           05  T2 pic X(34) value 'Get Line ASCII, Put Record EBCDIC '.
           05  T3 pic X(10) value ' v06.10.20'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBDCRDC1 '.
           05  C2 pic X(20) value 'Copyright 1987-2006 '.
           05  C3 pic X(28) value '  SimoTime Enterprises, LLC '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* CBDCRDC1 '.
           05  C2 pic X(32) value 'Thank you for using this sample '.
           05  C3 pic X(32) value 'by SimoTime Enterprises, LLC    '.
           05  C4 pic X(04) value '    '.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* CBDCRDC1 '.
           05  C2 pic X(32) value 'Please send comments or suggesti'.
           05  C3 pic X(32) value 'ons to helpdesk@simotime.com    '.
           05  C4 pic X(04) value '    '.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBDCRDC1 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

       01  SYSUT1-TOTAL.
           05  filler      pic X(23)   value 'Input Record count is  '.
           05  SYSUT1-RDR  pic 9(9)    value 0.
           05  filler      pic X       value SPACE.

       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  RC-FOR-PROGRAM          pic 9(4)     value 0.

       COPY PASSGL80.
       COPY PASSPR80.
       COPY PASSXT80.

      *****************************************************************
       PROCEDURE DIVISION.
           perform Z-POST-COPYRIGHT
           move 'A2E' to XT80-REQUEST

           perform GET080LS-OPEN
           perform PUT080RS-OPEN

           move 'READ    ' to GL80-FILE-REQUEST
           move ZERO to SYSUT1-RDR
           move ZERO to GL80-FILE-STATUS
           perform until GL80-FILE-STATUS not = 0
               call 'SIMOGL80' using GL80-PASS-AREA
               if  GL80-FILE-STATUS = 0
                   move GL80-PASS-80 to XT80-DATA
                   call 'SIMOXT80' using XT80-PASS-AREA
                   move XT80-DATA to PR80-PASS-80
                   perform PUT080RS-WRITE
                   add 1 to SYSUT1-RDR
               end-if
           end-perform

           display '* CBDCRDC1 GL80 Status '
                    GL80-FILE-STATUS

           if  GL80-FILE-STATUS = 0
           or  GL80-FILE-STATUS = 10
               move Zero to RC-FOR-PROGRAM
           end-if

           move SYSUT1-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           perform PUT080RS-CLOSE
           perform GET080LS-CLOSE

           perform Z-THANK-YOU.

           add RC-FOR-PROGRAM to ZERO giving RETURN-CODE

           GOBACK.

      *****************************************************************
       GET080LS-READ.

           exit.

      *---------------------------------------------------------------*
       GET080LS-OPEN.
           move 'FILE    ' to GL80-PASS-REQUEST
           move 'OPEN    ' to GL80-FILE-REQUEST
           call 'SIMOGL80' using GL80-PASS-AREA
           if  GL80-FILE-STATUS not = 0
               move GL80-FILE-STATUS to MESSAGE-TEXT
               move ' - Failed the OPEN of GET080LS Sequential file '
                 to MESSAGE-TEXT(6:38)
               perform Z-DISPLAY-MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *---------------------------------------------------------------*
       GET080LS-CLOSE.
           move 'CLOSE   ' to GL80-FILE-REQUEST
           call 'SIMOGL80' using GL80-PASS-AREA
           exit.


      *****************************************************************
       PUT080RS-WRITE.
           move 'WRITE' to PR80-FILE-REQUEST
           call 'SIMOPR80' using PR80-PASS-AREA
           exit.

      *---------------------------------------------------------------*
       PUT080RS-OPEN.
           move 'FILE    ' to PR80-PASS-REQUEST
           move 'OPEN    ' to PR80-FILE-REQUEST
           call 'SIMOPR80' using PR80-PASS-AREA
           if  PR80-FILE-STATUS = 0
               move 'Successful OPEN of PUT080 Sequential file'
                 to MESSAGE-TEXT
           else
               move PR80-FILE-STATUS to MESSAGE-TEXT
               move ' - Failed the OPEN of PUT080 Sequential file '
                 to MESSAGE-TEXT(6:38)
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *---------------------------------------------------------------*
       PUT080RS-CLOSE.
           move 'CLOSE   ' to PR80-FILE-REQUEST
           call 'SIMOPR80' using PR80-PASS-AREA
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if  MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Enterprises         *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

COBOL, Read EBCDIC Record Sequential and Write ASCII/Text
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDC2.CBL) is a sample of the COBOL program that will read an EBCDIC-encoded file with eighty (80) byte, fixed length records and write to an ASCII-encoded, text file with variable length records.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBDCRDC2.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      * Copyright (C) 1987-2007 SimoTime Enterprises, LLC.            *
      *                                                               *
      * 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 commercial purpose requires a fee to be paid to       *
      * SimoTime Enterprises. 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           *
      * Enterprises.                                                  *
      *                                                               *
      * Permission to use, copy and modify 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           *
      * Enterprises.                                                  *
      *                                                               *
      * SimoTime Enterprises makes no warranty or representations     *
      * about the suitability of the software for any purpose. It is  *
      * provided "AS IS" without any express or implied warranty,     *
      * including the implied warranties of merchantability, fitness  *
      * for a particular purpose and non-infringement. SimoTime       *
      * Enterprises 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 Enterprises                                          *
      * 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 Enterprises,  *
      * 15 Carnoustie Drive, Novato, CA 94949-5849.                   *
      *                                                               *
      *****************************************************************
      *      This program is provided by SimoTime Enterprises         *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * MAINTENANCE
      * -----------
      * 1994/02/27 Simmons, Created program.
      *
      *****************************************************************
      * Source Member: CBDCRDC2.CBL
      * Copy Files:    PASSGR80
      *                PASSPL80
      *****************************************************************
       DATA DIVISION.
       WORKING-STORAGE SECTION.
      *****************************************************************
      *    Data-structure for Title and Copyright...
      *****************************************************************
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CBDCRDC2 '.
           05  T2 pic X(34) value 'Get Record EBCDIC, Put Line ASCII '.
           05  T3 pic X(10) value ' v06.10.20'.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBDCRDC2 '.
           05  C2 pic X(20) value 'Copyright 1987-2007 '.
           05  C3 pic X(28) value '  SimoTime Enterprises, LLC '.
           05  C4 pic X(20) value ' All Rights Reserved'.

       01  SIM-THANKS-01.
           05  C1 pic X(11) value '* CBDCRDC2 '.
           05  C2 pic X(32) value 'Thank you for using this sample '.
           05  C3 pic X(32) value 'by SimoTime Enterprises, LLC    '.
           05  C4 pic X(04) value '    '.

       01  SIM-THANKS-02.
           05  C1 pic X(11) value '* CBDCRDC2 '.
           05  C2 pic X(32) value 'Please send comments or suggesti'.
           05  C3 pic X(32) value 'ons to helpdesk@simotime.com    '.
           05  C4 pic X(04) value '    '.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBDCRDC2 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

       01  SYSUT1-TOTAL.
           05  filler      pic X(23)   value 'Input Record count is  '.
           05  SYSUT1-RDR  pic 9(9)    value 0.
           05  filler      pic X       value SPACE.

       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  RC-FOR-PROGRAM          pic 9(4)     value 0.

       COPY PASSGR80.
       COPY PASSPL80.
       COPY PASSXT80.

      *****************************************************************
       PROCEDURE DIVISION.
           perform Z-POST-COPYRIGHT
           move 'E2A' to XT80-REQUEST

           perform GET080RS-OPEN
           perform PUT080LS-OPEN

           move 'READ    ' to GR80-FILE-REQUEST
           move ZERO to SYSUT1-RDR
           move ZERO to GR80-FILE-STATUS
           perform until GR80-FILE-STATUS not = 0
               call 'SIMOGR80' using GR80-PASS-AREA
               if  GR80-FILE-STATUS = 0
                   move GR80-PASS-80 to XT80-DATA
                   call 'SIMOXT80' using XT80-PASS-AREA
                   move XT80-DATA to PL80-PASS-80
                   perform PUT080LS-WRITE
                   add 1 to SYSUT1-RDR
               end-if
           end-perform

           display '* CBDCRDC2 GR80 Status '
                    GR80-FILE-STATUS

           if  GR80-FILE-STATUS = 0
           or  GR80-FILE-STATUS = 10
               move Zero to RC-FOR-PROGRAM
           end-if

           move SYSUT1-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT

           perform PUT080LS-CLOSE
           perform GET080RS-CLOSE

           perform Z-THANK-YOU.

           add RC-FOR-PROGRAM to ZERO giving RETURN-CODE

           GOBACK.

      *****************************************************************
       GET080LS-READ.

           exit.

      *---------------------------------------------------------------*
       GET080RS-OPEN.
           move 'FILE    ' to GR80-PASS-REQUEST
           move 'OPEN    ' to GR80-FILE-REQUEST
           call 'SIMOGR80' using GR80-PASS-AREA
           if  GR80-FILE-STATUS not = 0
               move GR80-FILE-STATUS to MESSAGE-TEXT
               move ' - Failed the OPEN of GET080RS Sequential file '
                 to MESSAGE-TEXT(6:38)
               perform Z-DISPLAY-MESSAGE-TEXT
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *---------------------------------------------------------------*
       GET080RS-CLOSE.
           move 'CLOSE   ' to GR80-FILE-REQUEST
           call 'SIMOGR80' using GR80-PASS-AREA
           exit.


      *****************************************************************
       PUT080LS-WRITE.
           move 'WRITE' to PL80-FILE-REQUEST
           call 'SIMOPL80' using PL80-PASS-AREA
           exit.

      *---------------------------------------------------------------*
       PUT080LS-OPEN.
           move 'FILE    ' to PL80-PASS-REQUEST
           move 'OPEN    ' to PL80-FILE-REQUEST
           call 'SIMOPL80' using PL80-PASS-AREA
           if  PL80-FILE-STATUS = 0
               move 'Successful OPEN of PUT080 Sequential file'
                 to MESSAGE-TEXT
           else
               move PL80-FILE-STATUS to MESSAGE-TEXT
               move ' - Failed the OPEN of PUT080 Sequential file '
                 to MESSAGE-TEXT(6:38)
           end-if
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *---------------------------------------------------------------*
       PUT080LS-CLOSE.
           move 'CLOSE   ' to PL80-FILE-REQUEST
           call 'SIMOPL80' using PL80-PASS-AREA
           exit.

      *****************************************************************
      * The following Z-Routines perform administrative tasks         *
      * for this program.                                             *
      *****************************************************************
      * ABEND the program, post a message to the console and issue    *
      * a STOP RUN.                                                   *
      *****************************************************************
       Z-ABEND-PROGRAM.
           if  MESSAGE-TEXT not = SPACES
               perform Z-DISPLAY-MESSAGE-TEXT
           end-if
           move 'PROGRAM-IS-ABENDING...'  to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TEXT
           add 12 to ZERO giving RETURN-CODE
           STOP RUN.
      *    exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           move SIM-TITLE to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-COPYRIGHT to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.

      *****************************************************************
      * Display CONSOLE messages...                                   *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TEXT.
           if  MESSAGE-TEXT-2 = SPACES
               display MESSAGE-BUFFER(1:79)
           else
               display MESSAGE-BUFFER
           end-if
           move all SPACES to MESSAGE-TEXT
           exit.

      *****************************************************************
       Z-THANK-YOU.
           move SIM-THANKS-01 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           move SIM-THANKS-02 to MESSAGE-BUFFER
           perform Z-DISPLAY-MESSAGE-TEXT
           exit.
      *****************************************************************
      *      This example is provided by SimoTime Enterprises         *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************

COBOL, Compare Two ASCII/Text
(Next) (Previous) (Table-of-Contents)

The following (CBLCRDC3.CBL) is a sample of the COBOL program that will compare the contents of the two ASCII-encoded text files.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CBLCRDC3.
       AUTHOR.        SIMOTIME ENTERPRISES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Enterprises                 *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2006-11-06  Generation Time: 15:25:50:51    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  INPUT     EXPECT80 ASCII/CRLF    VARIABLE   00080            *
      *                                                               *
      *  OUTPUT    ACTUAL80 ASCII/CRLF    VARIABLE   00080            *
      *                                                               *
      *                                                               *
      *                Translation Mode is UNKNOWN                    *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT EXPECT80-FILE  ASSIGN TO       EXPECT80
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS EXPECT80-STATUS.
           SELECT ACTUAL80-FILE  ASSIGN TO       ACTUAL80
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS ACTUAL80-STATUS.
           SELECT SYSUT3-FILE  ASSIGN TO       SYSUT3
                  ORGANIZATION  IS LINE SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS SYSUT3-STATUS.

      *****************************************************************
       DATA DIVISION.
       FILE SECTION.
       FD  EXPECT80-FILE
           DATA RECORD    IS EXPECT80-REC
           .
       01  EXPECT80-REC.
           05  EXPECT80-DATA-01 PIC X(00080).

       FD  ACTUAL80-FILE
           DATA RECORD    IS ACTUAL80-REC
           .
       01  ACTUAL80-REC.
           05  ACTUAL80-DATA-01 PIC X(00080).

       FD  SYSUT3-FILE
           DATA RECORD    IS SYSUT3-REC
           .
       01  SYSUT3-REC.
           05  SYSUT3-DATA-01 PIC X(80).

      *****************************************************************
      * This program was created using the SYSCOMP2.TXT file as the   *
      * template for the data file comparison. The positions to be    *
      * compared are determined by reading a control file at          *
      * execution time.                                               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Enterprises as follows.                                       *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CBLCRDC3 '.
           05  T2 pic X(34) value 'Data File Content Comparison      '.
           05  T3 pic X(10) value 'v06.09.08 '.
           05  T4 pic X(24) value ' http://www.simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CBLCRDC3 '.
           05  C2 pic X(20) value 'Created by SimoZAPS,'.
           05  C3 pic X(20) value '  a utility package '.
           05  C4 pic X(28) value 'of SimoTime Enterprises, LLC'.

       01  EXPECT80-STATUS.
           05  EXPECT80-STATUS-L     pic X.
           05  EXPECT80-STATUS-R     pic X.
       01  EXPECT80-EOF              pic X       value 'N'.
       01  EXPECT80-OPEN-FLAG        pic X       value 'C'.

       01  ACTUAL80-STATUS.
           05  ACTUAL80-STATUS-L     pic X.
           05  ACTUAL80-STATUS-R     pic X.
       01  ACTUAL80-EOF              pic X       value 'N'.
       01  ACTUAL80-OPEN-FLAG        pic X       value 'C'.

       01  SYSUT3-STATUS.
           05  SYSUT3-STATUS-L     pic X.
           05  SYSUT3-STATUS-R     pic X.
       01  SYSUT3-EOF              pic X       value 'N'.
       01  SYSUT3-OPEN-FLAG        pic X       value 'C'.

      *****************************************************************
      * The following buffers are used to create a four-byte status   *
      * code that may be displayed.                                   *
      *****************************************************************
       01  IO-STATUS.
           05  IO-STAT1            pic X.
           05  IO-STAT2            pic X.
       01  IO-STATUS-04.
           05  IO-STATUS-0401      pic 9     value 0.
           05  IO-STATUS-0403      pic 999   value 0.
       01  TWO-BYTES-BINARY        pic 9(4)  BINARY.
       01  TWO-BYTES-ALPHA         redefines TWO-BYTES-BINARY.
           05  TWO-BYTES-LEFT      pic X.
           05  TWO-BYTES-RIGHT     pic X.

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TEXT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(11)   value '* CBLCRDC3 '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(68)   value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.

      *****************************************************************
       01  APPL-RESULT             pic S9(9)    comp.
           88  APPL-AOK            value 0.
           88  APPL-EOF            value 16.

       01  READ-FLAGS.
           05  READ-1      pic X       value 'Y'.
           05  READ-2      pic X       value 'Y'.
       01  DUMP-FLAGS.
           05  DUMP-ASC    pic X       value 'Y'.
           05  DUMP-EBC    pic X       value 'Y'.
           05  DUMP-HEX    pic X       value 'Y'.

       01  COMPARE-STATUS  pic XX      value 'EQ'.
       01  FLAG-EQ         pic XX      value 'EQ'.
       01  FLAG-NE         pic XX      value 'NE'.
       01  FLAG-QT         pic XX      value 'QT'.
       01  DELTA-LINE      pic X(1024) value all '-'.
       01  PTR-1           pic 9(5)    value 0.
       01  PTR-2           pic 9(5)    value 0.
       01  IDX-2           pic 9(5)    value 0.
       01  DELTA-MAXIMUM-X pic X(5)    value '00250'.
       01  DELTA-MAXIMUM   redefines DELTA-MAXIMUM-X pic 9(5).
       01  DELTA-PROCESS   pic X(4)    value 'EOF '.

       01  YES-YES         pic XX      value 'YY'.
       01  N-BYTE          pic X       value 'N'.
       01  Y-BYTE          pic X       value 'Y'.

       01  KEY-ACTIVE      pic X       value 'Y'.
       01  KEY-CONTROL-1.
           05  PS-1        pic 9(5)    value 00000.
           05  LN-1        pic 9(5)    value 00000.
       01  KEY-CONTROL-2.
           05  PS-2        pic 9(5)    value 00000.
           05  LN-2        pic 9(5)    value 00000.

       01  EXPECT80-LRECL    pic 9(5)    value 00080.
       01  ACTUAL80-LRECL    pic 9(5)    value 00080.
       01  D-LEN           pic 9(5)    value 128.
       01  D-POS           pic 9(5)    value 1.

       01  ASC-OR-EBC      pic 9(3)    comp    value 0.
       01  ASC-OR-EBC-R    redefines ASC-OR-EBC.
           05  ASC-A       pic X.
           05  EBC-A       pic X.

      *    Header row for positional indicator...
       01  DUMP-H10.
           05  FILLER      pic X(5)    value '....:'.
           05  POS-NO      pic 9(5)    value 10.
       01  DUMP-HEADER     pic X(1024) value all '.'.
       01  D-P1            pic 9(5)    value 0.

       01  RECORD-HEADER.
           05  RECORD-ID   pic X(8)    value 'EXPECT80'.
           05  filler      pic X(2)    value '..'.
           05  REC-NUMBER  pic 9(9)    value 0.
           05  filler      pic X       value '('.
           05  RECORD-POS  pic 9(5)    value 0.
           05  filler      pic X       value ':'.
           05  RECORD-LEN  pic 9(5)    value 0.
           05  filler