Variable Length Records
Record Sequential & ASCII/Text Files
  Table of Contents  v-16.01.01 - vrs32k01.htm 
  Introduction
  Job Scripts, Bash
  Create the First Test File
  Convert First, Create Second File
  Convert Second, Create Final File
  Compare First and Final File
  Compare Results Equal
  Compare Results NOT Equal
  Hex-Dump, Second and Final File
  Logical Hex-Dump, Second File
  Logical Hex-Dump, Final File
  Physical Hex-Dump, Second File
  Physical Hex-Dump, Final File
  Program Preparation
  ASCII/Text to EBCDIC/RSEQ
  Generate the Program
  Compile the Program
  EBCDIC/RSEQ to ASCII/Text
  Generate the Program
  Compare ASCII/Text Files
  Generate the Program
  Hex Dump by Logical Record
  Hex-Dump, Second File
  Hex-Dump, Final File
  Hex Dump by Physical File
  Ancillary Functions & Files
  Batch Jobs, Windows
  Set the Base Environment
  Display & Log Messages
  Batch Jobs, Linux
  Set the Base Environment
  Display & Log Messages
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will describe and demonstrate how to access and process Record Sequential files with variable length records. The processing techniques include file create, convert, compare and view in a Hex Dump format. The file formats and record structures are commonly used with IBM Mainframe Systems or application programs that were created using the COBOL programming language.

The COBOL programs that do the file format conversion were generated using SIMOTIME Technology running on a Windows System with Micro Focus COBOL and a Linux (Ubuntu) System with GnuCOBOL.

1. Create the First Test File
1.1. This file is an ASCII/Text file with variable length records.
2. Convert the First File into a Second Test file
2.1. This Second file is a Record Sequential file with variable length records.
2.2. This process will read the first test file and create a second test file.
2.2.1. This process will do a file format conversion from Line Sequential to Record Sequential
2.2.2. This process will do a record content conversion from ASCII to EBCDIC
2.3. The first test file is not changed.
3. Convert the Second Test File into a Final Test File.
3.1. This Final file is an ASCII/Text file with variable length records.
4. Compare the First and Final Test Files
5. Hex-Dump of the Second and Final Test Files
5.1. Logical Hex-Dump of an ASCII/Text file with variable length records.
5.1.1. Intended for Application Programmers
5.1.2. Provides a Hex-Dump of the logical records within a file.
5.2. Logical Hex-Dump of a Record Sequential file with variable length records.
5.2.1. Intended for Application Programmers
5.2.2. Provides a Hex-Dump of the logical records within a file.
5.3. Physical Hex-Dump of a a file. This type of Hex-Dump uses byte-stream I/O to access a file.
5.3.1. Intended for System Programmers
5.3.2. Provides a Hex-Dump of the embedded physical file structural properties along with the logical records within a file.

The physical structure of files with variable length records will vary across Operating Systems and COBOL Technologies. This document will describe processing techniques that will adjust to these variances.


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-2018
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Job Scripts, Bash

A job script may be defined as a text file containing job setup information followed by job steps that identify programs to be executed along with parameters unique to the job step. A job script may be created using a text editor. The naming of a job script is determined by the Operating System. A simple job script may contain a single job step that performs a single function. A typical job script will contain multiple job steps executed in a predefined sequence. The status of each job step may be tested at the end of each job step.

Table of Contents Previous Section Next Section Create the First Test File

The following is a listing of the Bash Script member (txvrecs8.sh) that is used to create the First Test file. This Job Script will create an ASCII/Text file with variable length records.

#!/bin/bash
   JOBNAME=txvrecs8
#  *********************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  *********************************************************************
#  *
#  * Text   - Create a Line Sequential (or ASCII/Text)File with variable
#  *          length data strings.
#  * Author - SimoTime Technologies
#  * Date   = January 24, 1996
#  *
#  * This Job will run on an Ubuntu System. The job will use the Linux
#  * echo command to write a string of data to an ASCII/Text file.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of /USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   echo "# BASESYS1........... $BASESYS1"
   echo "# COB_LIBS........... $COB_LIBS"
   echo "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   echo "# SIMONOTE........... $SIMONOTE"
   simonote.sh "# StepInfo Delete previously created files"
   export TXVRECT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT1.txt
   if [ -f "$TXVRECT1" ]
   then
      rm $TXVRECT1
   fi
#  *
#  * *******************************************************************
#  * Step 2 of 3, Create and populate a new ASCII/TEXT file...
#  *              Use the Linux echo command to write a string of data
#  *              to an ASCII/Text file.
#  *
   simonote.sh "# StepInfo Create an ASCII/Text File"
#  * ..1....:....2....:....3....:....4....:....5....:....6....:....7.
echo "000000000001 A">>$TXVRECT1
echo "000000000002 AB">>$TXVRECT1
echo "000000000003 ABC">>$TXVRECT1
echo "000000000004 ABCD">>$TXVRECT1
echo "000000000005 ABCDE">>$TXVRECT1
echo "000000000006 ABCDEF">>$TXVRECT1
echo "000000000007 ABCDEFG">>$TXVRECT1
echo "000000000008 ABCDEFGH">>$TXVRECT1
echo "000000000009 ABCDEFGHI">>$TXVRECT1
echo "000000000010 ABCDEFGHIJ">>$TXVRECT1
echo "000000000011 ABCDEFGHIJK">>$TXVRECT1
echo "000000000012 ABCDEFGHIJKL">>$TXVRECT1
echo "000000000013 ABCDEFGHIJKLM">>$TXVRECT1
echo "000000000014 ABCDEFGHIJKLMN">>$TXVRECT1
echo "000000000015 ABCDEFGHIJKLMNO">>$TXVRECT1
echo "000000000016 ABCDEFGHIJKLMNOP">>$TXVRECT1
echo "000000000017 ABCDEFGHIJKLMNOPR">>$TXVRECT1
echo "000000000018 ABCDEFGHIJKLMNOPQR">>$TXVRECT1
echo "000000000019 ABCDEFGHIJKLMNOPQRS">>$TXVRECT1
echo "000000000020 ABCDEFGHIJKLMNOPQRST">>$TXVRECT1
echo "000000000021 ABCDEFGHIJKLMNOPQRSTU">>$TXVRECT1
echo "000000000022 ABCDEFGHIJKLMNOPQRSTUV">>$TXVRECT1
echo "000000000023 ABCDEFGHIJKLMNOPQRSTUVW">>$TXVRECT1
echo "000000000024 ABCDEFGHIJKLMNOPQRSTUVWX">>$TXVRECT1
echo "000000000025 ABCDEFGHIJKLMNOPQRSTUVWXY">>$TXVRECT1
echo "000000000026 ABCDEFGHIJKLMNOPQRSTUVWXYZ">>$TXVRECT1
echo "000000000027 ABCDEFGHIJKLMNOPQRSTUVWZXZ0123456789">>$TXVRECT1
echo "000000000028 ABCDEFGHIJKLMNOPQRSTUVWXYZ">>$TXVRECT1
echo "000000000029 ABCDEFGHIJKLMNOPQRSTUVWXY">>$TXVRECT1
echo "000000000030 ABCDEFGHIJKLMNOPQRSTUVWX">>$TXVRECT1
echo "000000000031 ABCDEFGHIJKLMNOPQRSTUVW">>$TXVRECT1
echo "000000000032 ABCDEFGHIJKLMNOPQRSTUV">>$TXVRECT1
echo "000000000033 ABCDEFGHIJKLMNOPQRSTU">>$TXVRECT1
echo "000000000034 ABCDEFGHIJKLMNOPQRST">>$TXVRECT1
echo "000000000035 ABCDEFGHIJKLMNOPQRS">>$TXVRECT1
echo "000000000036 ABCDEFGHIJKLMNOPQR">>$TXVRECT1
echo "000000000037 ABCDEFGHIJKLMNOPQ">>$TXVRECT1
echo "000000000038 ABCDEFGHIJKLMNOR">>$TXVRECT1
echo "000000000039 ABCDEFGHIJKLMNO">>$TXVRECT1
echo "000000000040 ABCDEFGHIJKLMN">>$TXVRECT1
echo "000000000041 ABCDEFGHIJKLM">>$TXVRECT1
echo "000000000042 ABCDEFGHIJKL">>$TXVRECT1
echo "000000000043 ABCDEFGHIJK">>$TXVRECT1
echo "000000000044 ABCDEFGHIJ">>$TXVRECT1
echo "000000000045 ABCDEFGHI">>$TXVRECT1
echo "000000000046 ABCDEFGH">>$TXVRECT1
echo "000000000047 ABCDEFG">>$TXVRECT1
echo "000000000048 ABCDEF">>$TXVRECT1
echo "000000000049 ABCDE">>$TXVRECT1
echo "000000000050 ABCD">>$TXVRECT1
echo "000000000051 ABC">>$TXVRECT1
echo "000000000052 AB">>$TXVRECT1
echo "000000000053 A">>$TXVRECT1
echo "000000000054 a">>$TXVRECT1
echo "000000000055 ab">>$TXVRECT1
echo "000000000056 abc">>$TXVRECT1
echo "000000000057 abcd">>$TXVRECT1
echo "000000000058 abcde">>$TXVRECT1
echo "000000000059 abcdef">>$TXVRECT1
echo "000000000060 abcdefg">>$TXVRECT1
echo "000000000061 abcdefgh">>$TXVRECT1
echo "000000000062 abcdefghi">>$TXVRECT1
echo "000000000063 abcdefghij">>$TXVRECT1
echo "000000000064 abcdefghijk">>$TXVRECT1
echo "000000000065 abcdefghijkl">>$TXVRECT1
echo "000000000066 abcdefghijklm">>$TXVRECT1
echo "000000000067 abcdefghijklmn">>$TXVRECT1
echo "000000000068 abcdefghijklmno">>$TXVRECT1
echo "000000000069 abcdefghijklmnop">>$TXVRECT1
echo "000000000070 abcdefghijklmnopr">>$TXVRECT1
echo "000000000071 abcdefghijklmnopqr">>$TXVRECT1
echo "000000000072 abcdefghijklmnopqrs">>$TXVRECT1
echo "000000000073 abcdefghijklmnopqrst">>$TXVRECT1
echo "000000000074 abcdefghijklmnopqrstu">>$TXVRECT1
echo "000000000075 abcdefghijklmnopqrstuv">>$TXVRECT1
echo "000000000076 abcdefghijklmnopqrstuvw">>$TXVRECT1
echo "000000000077 abcdefghijklmnopqrstuvwx">>$TXVRECT1
echo "000000000078 abcdefghijklmnopqrstuvwxy">>$TXVRECT1
echo "000000000079 abcdefghijklmnopqrstuvwxyz">>$TXVRECT1
echo "000000000080 abcdefghijklmnopqrstuvwzxz0123456789">>$TXVRECT1
echo "000000000081 abcdefghijklmnopqrstuvwxyz">>$TXVRECT1
echo "000000000082 abcdefghijklmnopqrstuvwxy">>$TXVRECT1
echo "000000000083 abcdefghijklmnopqrstuvwx">>$TXVRECT1
echo "000000000084 abcdefghijklmnopqrstuvw">>$TXVRECT1
echo "000000000085 abcdefghijklmnopqrstuv">>$TXVRECT1
echo "000000000086 abcdefghijklmnopqrstu">>$TXVRECT1
echo "000000000087 abcdefghijklmnopqrst">>$TXVRECT1
echo "000000000088 abcdefghijklmnopqrs">>$TXVRECT1
echo "000000000089 abcdefghijklmnopqr">>$TXVRECT1
echo "000000000090 abcdefghijklmnopq">>$TXVRECT1
echo "000000000091 abcdefghijklmnor">>$TXVRECT1
echo "000000000092 abcdefghijklmno">>$TXVRECT1
echo "000000000093 abcdefghijklmn">>$TXVRECT1
echo "000000000094 abcdefghijklm">>$TXVRECT1
echo "000000000095 abcdefghijkl">>$TXVRECT1
echo "000000000096 abcdefghijk">>$TXVRECT1
echo "000000000097 abcdefghij">>$TXVRECT1
echo "000000000098 abcdefghi">>$TXVRECT1
echo "000000000099 abcdefgh">>$TXVRECT1
echo "000000000100 abcdefg">>$TXVRECT1
echo "000000000101 abcdef">>$TXVRECT1
echo "000000000102 abcde">>$TXVRECT1
echo "000000000103 abcd">>$TXVRECT1
echo "000000000104 abc">>$TXVRECT1
echo "000000000105 ab">>$TXVRECT1
echo "000000000106 a">>$TXVRECT1
#  *
   if [ -f "$TXVRECT1" ]
   then
     simonote.sh "# TXVRECT1 is $TXVRECT1"
   else
     simonote.sh "# ABENDING File not created, $TXVRECT1"
     exit 9001
   fi
#  *
#  * *******************************************************************
#  * Step 3 of 3, End of Job Processing...
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Convert First, Create Second File

The following is a listing of the Bash Script member (l1kv32s1.sh) that is used to create the Second Test File. This Job Script will create an EBCDIC encoded, Record Sequential file with variable length records.

#!/bin/bash
   JOBNAME=l1kv32s1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Convert ASCII/text, to Variable records Sequential file
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * This Job will run on an Ubuntu System using GnuCOBOL.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT1.txt
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/EBC1/SIMOTIME.DATA.SQVRECD1.dat
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATAMAKE is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Convert an ASCII/Text File to a Record Sequential File
#  *              that contains EBCDIC-encoded, variable length records.
#  *              The record size varies from 4-32,760 bytes.
#  *              Note: the tee command will write to both the standard
#  *                    output device and a file.
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun L1KV32C1 | tee $BASESYS1/SIMOSAM1/DEVL/LOGS/SYSOUT_USERPROG_L1KVXEC1.txt
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Convert Second, Create Final File

The following is a listing of the Bash Script member (v32l1ks1.sh) that is used to create the Final Test File. This Job Script will create an ASCII/Text file with variable length records.

#!/bin/bash
   JOBNAME=v32l1ks1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Convert Sequential file, Variable records to ASCII/text
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * This Job will run on an Ubuntu System using GnuCOBOL.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/EBC1/SIMOTIME.DATA.SQVRECD1.dat
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT2.txt
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATAMAKE is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Convert a Record Sequential File that contains EBCDIC
#  *              encoded, variable length records to an ASCII/Text File.
#  *              Note: the tee command will write to both the standard
#  *                    output device and a file.
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun V32L1KC1 | tee $BASESYS1/SIMOSAM1/DEVL/LOGS/SYSOUT_USERPROG_VXEL1KC1.txt
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Compare First and Final File

The following is a listing of the Bash Script member (cpls1ks3.sh) used in this example.

#!/bin/bash
   JOBNAME=cpls1ks3
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Execute program, Compare two Line Sequential Files
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * Prepare the environment by mapping the file names.
#  * Execute the compare program.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT1.txt
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT2.txt
   export SYSUT3=$BASESYS1/SIMOSAM1/DEVL/PARMLIB/CPLS1KT3.ctl
   export SYSLUSER=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.HEXDUMP.SYSLUSER.txt
   simonote.sh "# SYSUT1 .... $SYSUT1"
   simonote.sh "# SYSUT2 .... $SYSUT2"
   simonote.sh "# SYSUT3 .... $SYSUT3"
   simonote.sh "# SYSLUSER .. $SYSLUSER"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *              Note: the tee command will write to both the standard
#  *                    output device and a file.
#  *
   cobcrun CPLS1KC3 | tee $BASESYS1/SIMOSAM1/DEVL/LOGS/SYSOUT_$JOBNAME_CPLS1KC3.txt
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Compare Results Equal

The following shows the information that is posted to the user screen and the Log File (SYSLUSER) when the compare processing produces an EQUAL result.

*******************************************************************************
* CPLS1KC3 Compare LSEQ, max=1024 with SYSUT3 v16.01.01   helpdesk@simotime.com
* CPLS1KC3 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
Starting  - Compare LSEQ, max=1024 with SYSUT3          http://www.SimoTime.com
Conclude  - Compare LSEQ, max=1024 with SYSUT3
000000106 - Record count for SYSUT1
000000106 - Record count for SYSUT2
000000000 - NOT Equal count for compare of existing records
000000106 - Number of matching record pairs for Compare Task
Finished  - Compare LSEQ, max=1024 with SYSUT3          http://www.SimoTime.com

Table of Contents Previous Section Next Section Compare Results NOT Equal

The following shows the information that is posted to the user screen and the Log File (SYSLUSER) when the compare processing produces a NOT EQUAL result.

*******************************************************************************
* CPLS1KC3 Compare LSEQ, max=1024 with SYSUT3 v16.01.01   helpdesk@simotime.com
* CPLS1KC3 This Data File Compare Member was generated by SimoTime Technologies
*******************************************************************************
Starting  - Compare LSEQ, max=1024 with SYSUT3          http://www.SimoTime.com
*
....:...10....:...20....:...30....:...40.........
SYSUT1....000000027(00001:00080) SYSUT3      SYSUT3
000000000027 ABCDEFGHIJKLMNOPQRSTUVWZXZ0123456789
3333333333332444444444444444555555555553333333333
0000000000270123456789ABCDEF01234567A8A0123456789
=======================================#=========
SYSUT2....000000027(00001:00080) SYSUT3      SYSUT3
000000000027 ABCDEFGHIJKLMNOPQRSTUVWZXZ#123456789
3333333333332444444444444444555555555552333333333
0000000000270123456789ABCDEF01234567A8A3123456789
=======================================#=========

*******************************************************************************
Conclude  - Compare LSEQ, max=1024 with SYSUT3
000000106 - Record count for SYSUT1
000000106 - Record count for SYSUT2
000000001 - NOT Equal count for compare of existing records
000000105 - Number of matching record pairs for Compare Task
ABENDING  - Compare LSEQ, max=1024 with SYSUT3          http://www.SimoTime.com

Table of Contents Previous Section Next Section Hex-Dump, Second and Final File

SIMOTIME provides a logical and physical methodology for creating a Hexadecimal view (HEX-Dump) of non-relational data structures (or data files). The logical hex-dump is intended for application programmers and simply presents the individual records within a file. The physical hex-dump is intended for system programmers and presents the individual records within a file along with the embedded structural information about the file.

Table of Contents Previous Section Next Section Logical Hex-Dump, Second File

The following is a listing of the Bash Script member (hxv32ks5.sh) that is used to produce a Hex-Dump view of records within a Record Sequential file containing variable length records.

#!/bin/bash
   JOBNAME=hxv32ks5
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Execute program, Hex Dump of a Record Sequential file
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * Prepare the environment by mapping the file names.
#  * Execute the Hex Dump program.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "# $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/EBC1/SIMOTIME.DATA.SQVRECD1.dat
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.HEXDUMP.SQVRECD5.txt
   export SYSUT3=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME_CNTL_F5249105.txt
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATADUMP is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun HXV32KC5 | tee $SYSUT2
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Logical Hex-Dump, Final File

The following is a listing of the Bash Script member (hxls1ks1.sh) that is used to produce a Hex-Dump view of records within an ASCII/Text file containing variable length records.

#!/bin/bash
   JOBNAME=hxls1ks1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2017 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Execute program, Hex Dump of an ASCII/Text file
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * Prepare the environment by mapping the file names.
#  * Execute the Hex Dump program.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "# $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT2.txt
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME_HEXDUMP_TXVRECT2.txt
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATADUMP is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun SIMOZAPS HEXCESS $SYSUT1 VIEW=1 STOP=9999999 | tee $SYSUT2
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Physical Hex-Dump, Second File

The following is a listing of the Bash Script member (v32khps1.sh) used in this example.

#!/bin/bash
   JOBNAME=v32khps1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Execute program, Hex Dump of an ASCII/Text file
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * Prepare the environment by mapping the file names.
#  * Execute the Hex Dump program.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "# $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT1.txt
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME_HEXDUMP_TXVRECT1.txt
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATADUMP is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun SIMOZAPS HEXCESS $SYSUT1 VIEW=1 STOP=9999999 | tee $SYSUT2
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Physical Hex-Dump, Final File

The following is a listing of the Bash Script member (v32khps2.sh) used in this example.

#!/bin/bash
   JOBNAME=v32khps1
#  * *******************************************************************
#  *       Bash Script File - provided by SimoTime Technologies        *
#  *           (C) Copyright 1987-2018 All Rights Reserved             *
#  *             Web Site URL:   http://www.simotime.com               *
#  *                   e-mail:   helpdesk@simotime.com                 *
#  * *******************************************************************
#  *
#  * Text    - Execute program, Hex Dump of an ASCII/Text file
#  * Author  - SimoTime Technologies
#  * Date    - November 11, 2003
#  * Version - 06.07.16
#  *
#  * Prepare the environment by mapping the file names.
#  * Execute the Hex Dump program.
#  *
#  * ********************************************************************
#  * Step 1 of 3, Prepare the System Environment.
#  *
   JOBSTATUS=0
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "# $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done
#  *
   simonote.sh "# **************************************************************$JOBNAME"
   simonote.sh "# Starting Job Name $JOBNAME"
   simonote.sh "# BASESYS1........... $BASESYS1"
   simonote.sh "# COB_LIBS........... $COB_LIBS"
   simonote.sh "# COB_LIBRARY_PATH... $COB_LIBRARY_PATH"
   simonote.sh "# SIMONOTE........... $SIMONOTE"
#  *
#  * Prepare the environment, map the file names...
   export SYSUT1=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME.DATA.TXVRECT2.txt
   export SYSUT2=$BASESYS1/SIMOSAM1/DEVL/DATA/TXT1/SIMOTIME_HEXDUMP_TXVRECT2.txt
   simonote.sh "# DATATAKE is $SYSUT1"
   simonote.sh "# DATADUMP is $SYSUT2"
#  *
#  * ********************************************************************
#  * Step 2 of 3, Run the program.
#  *
   if [ -f "$SYSUT2" ]
   then
      rm $SYSUT2
   fi
   cobcrun SIMOZAPS HEXCESS $SYSUT1 VIEW=1 STOP=9999999 | tee $SYSUT2
   rc=$?
   if [ $rc != 0 ]
   then
      simonote.sh "# ABENDING $name - Return Code is $rc"
      JOBSTATUS=$rc
   else
      ((AOK_Count++))
   fi
#  *
#  * ********************************************************************
#  * Step 3 of 3, End of Job Processing.
#  *
   if [ "$JOBSTATUS" = "0" ]
   then
      simonote.sh "# Finished Job Name $JOBNAME"
   else
      simonote.sh "# ABENDING Job Name $JOBNAME"
   fi


Table of Contents Previous Section Next Section Program Preparation

The COBOL programs used in the batch jobs are generated using SIMOTIME Technologies.

Table of Contents Previous Section Next Section ASCII/Text to EBCDIC/RSEQ

The input for this generated COBOL program is a Line Sequential (or ASCII/Text) file. The output file is an EBCDIC-encoded, Record Sequential file with variable length records.

This file format is supported by Micro Focus and GnuCOBOL.

Table of Contents Previous Section Next Section Generate the Program

The following is a listing of the Process Control File (L1KV3201.pcf) used to generate the COBOL Source member.

***********************************************************************
*    This Process Control File is provided by SimoTime Enterprises    *
*             (C) Copyright 1987-2018 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is an ASCII/Text file with variable-length records.          *
* SYSUT2 is a Record Sequential file with variable-length records.    *
***********************************************************************
* This Process Control File will be used to generate a callable COBOL
* routine.
* Refer to the utconv01.htm document for additional detail.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCONV
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Convert LSEQ File to VREC 4-32,760
&PROGID    L1KV32C1
&SYSUT1    org=ASCII/Text recfm=VARIABLE rmin=4 rmax=32760 RECMODE RECVARY
&SYSUT2    org=Sequential recfm=VARIABLE rmin=4 rmax=32760 RECMODE RECVARY TRUNC=SYSUT1
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the record content
* conversion program to be generated.
*
&TRANSMODE A2E
&TRANSINIT SPACES
&TransVREC ENABLE TRUNC MOVE CONV
*
&END

Table of Contents Previous Section Next Section Compile the Program

The following is a listing of the Process Control File (L1KV3201.pcf) used in this example.

cobc -fixed -std=mf -fassign-clause=ibm -ftab-width=4 $SLIB/COBOLUT2/$nameuc.cbl -o $TLIB/$nameuc.so -I SIMOSAM1/DEVL/COBCPY1 -t $LLIB/$name.prn

Table of Contents Previous Section Next Section EBCDIC/RSEQ to ASCII/Text

The input for this generated COBOL program is an EBCDIC-encoded, Record Sequential file with variable length records. The output file is a Line Sequential (or ASCII/Text) file.

This file format is supported by Micro Focus and GnuCOBOL.

Table of Contents Previous Section Next Section Generate the Program

The following is a listing of the Process Control File (V32L1K01.pcf) used to generate the COBOL Source member.

***********************************************************************
*   V32L1K01.pcf - read a VREC file (32,760), write ASCII/Text File   *
*    This Process Control File is provided by SimoTime Technologies   *
*             (C) Copyright 1987-2018 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is an EBC-encoded, RSEQ file with variable-length records.   *
* SYSUT1 is an ASC-encoded, LSEQ file with variable-length records.   *
***********************************************************************
* This Process Control File will be used to generate a single COBOL
* program that will convert each record in a file as a single text
* string. The files contain variable length records.
* Refer to the utconv01.htm document for additional detail.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCONV
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Convert an EBC-VREC to an ASC-Text
&PROGID    V32L1KC1
&SYSUT1    org=Sequential recfm=VARIABLE rmin=4 rmax=32760 RECMODE RECVARY
&SYSUT2    org=ASCII/Text recfm=VARIABLE rmin=4 rmax=1024  RECMODE RECVARY TRUNC=SYSUT1
*
* The following group of statements will define the behavioral
* characteristics and environment variables for the record content
* conversion routine to be generated.
*
&TRANSMODE E2A
&TRANSINIT x'40'
&TRANSVREC ENABLE trunc move conv
*TRANSlate from pos 1 len 1024 to pos 1 len 1024
*LREC2CONV
*USER2CONV from pos 1 len 1024 to pos 1 len 1024
*
&END

TAG

Table of Contents Previous Section Next Section Compare ASCII/Text Files

The inputs for this generated COBOL program are the First and Final files (two ASCII/Text files) created in previously executed Jobs or Job Steps. The output file is a Line Sequential (or ASCII/Text) file.

Table of Contents Previous Section Next Section Generate the Program

The following is a listing of the Process Control File (CPLS1K03.pcf) used to generate the COBOL Source member.

* PCFNAME=CPLS1K03
***********************************************************************
*                       A Process Control File                        *
*               Generate a Data File Comparison Program               *
*                        SimoTime Technologies                        *
*            (C) Copyright 1987-2018 All Rights Reserved              *
*              Web Site URL:   http://www.simotime.com                *
*                    e-mail:   helpdesk@simotime.com                  *
***********************************************************************
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCOMP
&FUNCTION  COMPARE
&CONFORM   IBM
&USRMODEL  SYSCOMP5.txt
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O
* functions within the Program to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Compare LSEQ, max=1024 with SYSUT3
&PROGID    CPLS1KC3
&SYSUT1    org=ASCII/Text recfm=VARIABLE rmin=1 rmax=1024 RECMODE RECVARY
&SYSUT2    org=ASCII/Text recfm=VARIABLE rmin=1 rmax=1024 RECMODE RECVARY
&SYSUT3    org=ASCII/Text recfm=FIXED rlen=80
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the compare functions
* within the Program to be generated.
*
* ..:....1....:....2....:....3....:....4....:....5....:....6....
&KEYFIELD  SYSUT1 pos  1 len 12 SYSUT2 pos  1 len  12
&DELTAMAX  10 EOF
&IFNECODE  0016
*
* The following group of statements will define the presentation
* characteristics for the Hex-Dump Format and Output Devices.
*
&DFORMAT   ASC HEX NOEBC NEDETAIL RPI
&DISPLAY   SYSOUT
&SYSLOG    ENABLE
*
&END

The compare processing logic will post messages to the user screen and a log file. When a NOT EQUAL condition occurs the compare logic may post record content to the user screen and a log file. The presentation of record content to the user screen and log file is configurable.

Table of Contents Previous Section Next Section Hex Dump by Logical Record

The logical hex-dump is intended for application programmers and simply presents the individual records within a file.

Table of Contents Previous Section Next Section Hex-Dump, Second File

The following is a listing of the Process Control File (HXV32K05.pcf) used to generate a HEX-Dump program.

***********************************************************************
*                HXV32K05.pcf - a Process Control File                *
*    Hex-Dump for a Sequential File with Variable-Length records      *
*             (C) Copyright 1987-2018 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 - Record Sequential file, 4-32760 variable-length records.   *
* SYSUT2 - Line Sequential file, 080-byte maximum length records.     *
* SYSUT3 - Line Sequential file, 32760-byte maximum length records.   *
***********************************************************************
* This Process Control File will be used to generate a COBOL program
* that will do a hexadecimal dump of the user-defined records
* contained in a record sequential file.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\ENV1BASE
&USERPREP  call USERCOGI
&CONFORM   IBM
&USRMODEL  Y4X32RS1.txt
&USRXFILE  AE0437B1
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Batch, HEX-Dump RSEQ LRECL=4x32760
&PROGID    HXV32KC5
&UT1READ   SEQUENTIAL
&SYSUT1    name=SYSUT1 org=Sequential recfm=variable rmin=4 rmax=32760 RECMODE RECVARY
&SYSUT2    name=SYSUT2 org=ASCII/Text recfm=variable rmin=4 rmax=32760 TRUNC=SYSUT1
&SYSUT3    name=SYSUT3 org=ASCII/Text recfm=FIXED rlen=080
*
* WIP...
*
*HEXOPEN   OUTPUT or EXTEND
&TRANSVREC ENABLE trunc move conv
&HEXDUMP   SYSUT1 pos 0001 len 0256

*HEXFIRST
*HEXFINAL
*HEXLIMIT
*
&END

Table of Contents Previous Section Next Section Hex-Dump, Final File

The following is a listing of the Bash Script member (HXLS1K05.pcf) used to generate a HEX-Dump program..

***********************************************************************
*                HXLS1K05.pcf - a Process Control File                *
*    Hex-Dump for a Sequential File with Variable-Length records      *
*             (C) Copyright 1987-2018 All Rights Reserved             *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 - Record Sequential file, 4-32760 variable-length records.   *
* SYSUT2 - Line Sequential file, 080-byte maximum length records.     *
* SYSUT3 - Line Sequential file, 32760-byte maximum length records.   *
***********************************************************************
* This Process Control File will be used to generate a COBOL program
* that will do a hexadecimal dump of the user-defined records
* contained in a record sequential file.
*
* The following group of statements will define the high level
* functions and processes to be performed.
*
&SIMOPREP  call ..\ENV1BASE
&USERPREP  call USERCOGI
&CONFORM   IBM
&USRMODEL  Y4X32RS1.txt
&USRXFILE  AE0437B1
*
* The following group of statements will define the behavioral
* characteristics and environment variable for the file I/O Program
* to be generated.
*
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Batch, HEX-Dump LSEQ LRECL=1024
&PROGID    HXLS1KC5
&UT1READ   SEQUENTIAL
&SYSUT1    name=SYSUT1 org=ASCII/Text recfm=variable rmin=4 rmax=1024 RECMODE RECVARY
&SYSUT2    name=SYSUT2 org=ASCII/Text recfm=variable rlen=1024 TRUNC=SYSUT1
&SYSUT3    name=SYSUT3 org=ASCII/Text recfm=FIXED rlen=080
*
* WIP...
*
*HEXOPEN   OUTPUT or EXTEND
&TRANSVREC ENABLE trunc move conv
&HEXDUMP   SYSUT1 pos 0001 len 0256

*HEXFIRST
*HEXFINAL
*HEXLIMIT
*
&END

Table of Contents Previous Section Next Section Hex Dump by Physical File

The physical hex-dump is intended for system programmers and presents the individual records within a file along with the embedded structural information about the file. The SIMOZAPS Utility program (a part of the SIMOTIME suite of Utility programs) is used on a Linux, UNIX or Windows System to produce a Physical Hex-Dump of a data file.

Table of Contents Previous Section Next Section Ancillary Functions & Files

This section provides information about program members that are used by this suite of programs and shared with other tasks or applications. These ancillary program members are available as a separate package or as part of the SIMOTIME Enterprise package.

This link provides detailed information for the  Common or Shared  program members.

Table of Contents Previous Section Next Section Batch Jobs, Windows

The following members are for the Windows Environment. The Job Scripts use Command Files.

Table of Contents Previous Section Next Section Set the Base Environment

The following (ENV1BASE.cmd) is a Windows Command file that will set the commonly used environment variables. This member is used to provide a single point for managing the commonly used environment variables.

@echo OFF
rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2018 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 Technologies
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 SimoLIBR=c:\SimoLIBR
     set BASELIB1=c:\SIMOSAM1\DEVL
     set BASELIB8=c:\SimoSAM8
     set BaseWIP1=c:\SimoSAM1\WIP1
     set DATAZERO=c:\SIMODATA\DEVL\DATA\ZERO
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BASECAT=%BaseLib1%\DATA
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_USER.DAT
     set SYSOUT=%BASEAPP%\LOGS\SYSOUT_SIMSAM01.TXT
     set SLZMSG=%BASEAPP%\LOGS\SLZMSG_USER.TXT
     set PostNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     set SimoNOTE=%BASEAPP%\LOGS\JOBLOG_SIMONOTE.TXT
     call SIMONOTE "* SIMONOTE Job Log File is %SIMONOTE% "
rem  *
     set MQBASE=C:\Program Files\IBM\WebSphere MQ
rem  *
rem  * Set the location for the Apache-Tomcat Server...
     set CATALINA_HOME=C:\APACHETC\apache-tomcat-7.0.52
rem  *
rem  * Set the Environment for the Java Environment...
     set JAVABASE=C:\Program Files (x86)\Java\jdk1.8.0_112
     set JAVASDK="%JAVABASE%\bin"
     set JAVA_HOME=%JAVABASE%
     set JRE_HOME=%JAVABASE%
rem  *
rem  * Set the environment for the Micro Focus technology...
     set MIFOEDEV=C:\Program Files (x86)\Micro Focus\Enterprise Developer
     set MIFOVCBL=C:\Program Files (x86)\Micro Focus\Visual COBOL
     set MIFOESTU=C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0
     set MIFOEMFE="C:\Program Files (x86)\Micro Focus\Mainframe Express"
rem  *
rem  * Large file support, performance tuning and record locking of the File Handler
     set EXTFH=%BASESYS%\CONFIG\EXTFHBIG.CFG
rem  *
rem  * For IMS Support
     set ES_IMSLIB=%BASEAPP%\IMSLIB
     set ES_ACBLIB=%BASEAPP%\IMSLIB
rem  *
rem  * EZASOKETS Check EZASOKETS Enabled box or set ES_EZASOKET_SUPPORT=YES
     set EZACONFG=BASESYS1\CONFIG\EZACONFG.dat
rem  *
rem  * Resource Allocation and Performance for SORT and non-Relational Data
rem  set MFJSENGINE=SYNCSORT
     set SORTSCHEME=1
     set SORTSPACE=750000000
     set TMP=C:\SORTWORK
rem  *
     set ES_ALLOC_OVERRIDE=%BASESYS%\CONFIG\CATMAPA1.cfg
rem  * For CORE_ON_ERROR function, ABEND Dump
rem  *     set COBCONFIG_=%BASESYS%\CONFIG\diagnose.cfg
rem  *
rem  * Consolidated Trace Facility (CTF)
rem  *     set MFTRACE_CONFIG=%BASESYS%\CONFIG\ctf.cfg
rem  *     set MFTRACE_LOGS=c:\ctflogs
rem  *
rem  * For Job Restart, ABEND Recovery
     set MF_UCC11=Y
     set ES_JES_RESTART=Y
rem  *
rem  * Set environment for MFBSI (Micro Focus Batch Scheduling Interface)
     set ES_EMP_EXIT_1=mfbsiemx
     set MFBSI_DIR=%BASESYS%\LOGS\%JESSERVERNAME%
     set MFBSIEOP_CMD=ENABLE
     set MFBSIEOP_CSV=ENABLE
     set MFBSIEOP_HTM=ENABLE
     set MFBSIEOP_XML=ENABLE
rem  *
rem  * Set Behavior and Trace Flags for GETJOBDD
rem  *   Position=12345678/12345678
     set JDDFLAGS=nnnWnnnn/YYnnnnnn
rem  *
     set MAINFRAME_FLOATING_POINT=true
     set COBIDY=%BASEAPP%\COBIDY
     set COBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set LIBPATH=.;%BASEAPP%\LOADLIB;%BASESYS%\LOADLIB;%SimoLIBR%
     set TXDIR=%BASESYS%\LOADLIB;%MIFOBASE%
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%
rem  *
rem  * If not already set then set the PATH for Micro Focus Directories
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "EDEV" goto JUMPEDEV
     if "%MIFOSYS1%" == "VCBL" goto JUMPVCBL
     if "%MIFOSYS1%" == "ESTU" goto JUMPESTU
     if "%MIFOSYS1%" == "EMFE" goto JUMPEMFE
:JUMPEDEV
     set path=%BASESYS%\LOADLIB;%MIFOEDEV%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOEDEV%\CPYLIB
     set MIFOBASE=%MIFOEDEV%
     goto JUMPPATH
:JUMPVCBL
     set path=%MIFOVCBL%\bin;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set MIFOBASE=%MIFOVCBL%
     goto JUMPPATH
:JUMPESTU
     set MIFOBASE=%MIFOESTU%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
:JUMPEMFE
     set MIFOBASE=%MIFOEMFE%\Base
     set MIFOBIN=%MIFOBASE%\bin
     set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%JAVASDK%;%BASEAPP%\JAVA;%PATH%;
     set CobCpy=%BASEAPP%\CobCpy1;%BASEAPP%\CobCpy2;%BASEAPP%\CobCpy6;%SimoLIBR%;%MIFOBASE%\SOURCE
     goto JUMPPATH
rem  *
:JUMPPATH
     set SIMOPATH=Y
rem  *
     set USERCLASS=%BASELIB1%\LOADLIB
     set CLASSPATH=.
     set CLASSPATH=%CLASSPATH%;%JAVABASE%
     set CLASSPATH=%CLASSPATH%;%JAVABASE%\lib
     set CLASSPATH=%CLASSPATH%;\%USERCLASS%\simpacks
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes
     set CLASSPATH=%CLASSPATH%;C:\APACHETC\apache-tomcat-7.0.52\webapps\simotcat\WEB-INF\classes\simpacks
     if "%MIFOSYS1%" == "ESTU" set CLASSPATH=%CLASSPATH%;%MIFOBIN%
     if "%MIFOSYS1%" == "EDEV" set CLASSPATH=%CLASSPATH%;%MIFOEDEV%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%
     if "%MIFOSYS1%" == "VCBL" set CLASSPATH=%CLASSPATH%;%MIFOVCBL%\mfcobol.jar
rem  *
     set JobStatus=0000
     call SimoNOTE "* Settings CmdName ENV1BASE.cmd, Version 14.03.28, %MIFOSYS1%"
     call SimoNOTE "* BaseAPP ..... %BASEAPP%"
rem *      call SimoNOTE "* MFBSIDIR .... %MFBSI_DIR% "
     call SimoNOTE "* MIFOSYS1 is %MIFOSYS1% "
     call SimoNOTE "* MIFOBASE is %MIFOBASE% "
     call SimoNOTE "* SIMOLIBR is %SIMOLIBR% "

Table of Contents Previous Section Next Section Display & Log Messages

The following (SIMONOTE.cmd) is a Windows Command file that may be called from other scripts and expects a single parameter enclosed in double quotes. The double quotes will be removed. The text message will be displayed to the screen. Before writing to the log file a date and time stamp will be inserted in front of the message text.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *            (C) Copyright 1987-2018 All Rights Reserved            *
rem  *              Web Site URL:   http://www.simotime.com              *
rem  *                    e-mail:   helpdesk@simotime.com                *
rem  * *******************************************************************
rem  *
rem  * Text    - Display message on screen and write to a log file.
rem  * Author  - SimoTime Technologies
rem  *
rem  * This script may be called from other scripts and expects a single
rem  * parameter enclosed in double quotes. The double quotes will be
rem  * removed. Before writing to the log file a date and time stamp
rem  * will be inserted in front of the message text.
rem  *
rem  * Note: The tilde (~) removes leading/trailing double-quotes.
rem  *
if "%SimoNOTE%" == "" set SimoNOTE=c:\SimoLIBR\LOGS\SimoTime.LOG
echo %date% %time% %~1>> %SimoNOTE%
echo %~1

Table of Contents Previous Section Next Section Batch Jobs, Linux

The following members are for the Linux Environment. The Batch Job Scripts use Bash Script Files.

Table of Contents Previous Section Next Section Set the Base Environment

The following shows the snippet of code that is used at the start of a batch job. This snippet of code will access a configuration file (ENV4SYS1.cfg) and set the base system environment for batch job execution.

#!/bin/bash
   JOBNAME=jobname
   for textstring in $(cat ENV4SYS1.cfg);
   do
#      # * The following statement will replace all occurences
#      # * of USD_BASESYS1 with the value of the BASESYS1
#      # * environment variable.
       textstring=${textstring//USD_BASESYS1/$BASESYS1}
#      # * The following statement will replace all occurences
#      # * of USD_JOBNAME with the value of the JOBNAME
#      # * environment variable.
       textstring=${textstring/USD_JOBNAME/$JOBNAME}
       export $textstring
       rc=$?
       if [ $rc != 0 ]
       then
          simonote.sh "#  $textstring - Return Code is $rc"
          JOBSTATUS=$rc
       fi
   done

The following shows the content of the configuration file (ENV4SYS1.cfg) that is used to set the base environment. This member is used to provide a single point for managing the commonly used system environment variables.

BASESYS1=/home/larry/SIMOSY76
COB_LIBS=USD_BASESYS1/SIMOSAM1/DEVL/LOADLIB:USD_BASESYS1/SIMOLIBR
COB_LIBRARY_PATH=USD_BASESYS1/SIMOSAM1/DEVL/LOADLIB:USD_BASESYS1/SIMOLIBR
SIMONOTE=USD_BASESYS1/SIMOSAM1/DEVL/LOGS/JOBLOG_SIMONOTE_USD_JOBNAME.txt

When the configuration file is processed by a batch job script the "USD_" text string will be replaced by a the "$" symbol.

Table of Contents Previous Section Next Section Display & Log Messages

The following (simonote.sh) is a Linux Bash script file that may be called from other scripts and expects a single parameter enclosed in double quotes. The double quotes will be removed. The text message will be displayed to the screen. Before writing to the log file a date and time stamp will be inserted in front of the message text.

#!/bin/bash
#  * *******************************************************************
#  *                 simonote.sh - a Bash Script File                  *
#  *         This program is provided by SimoTime Technologies         *
#  *            (C) Copyright 1987-2018 All Rights Reserved            *
#  *              Web Site URL:   http://www.simotime.com              *
#  *                    e-mail:   helpdesk@simotime.com                *
#  * *******************************************************************
#  *
#  * Text    - Display message on screen and write to a log file.
#  * Author  - SimoTime Technologies
#  *
#  * This script may be called from other scripts and expects a single
#  * parameter enclosed in double quotes. The double quotes will be
#  * removed. Before writing to the log file a date and time stamp
#  * will be inserted in front of the message text.
#  *
#  * Note: The tilde (~) removes leading/trailing double-quotes.
#  *
#  * "$simonote" == "" export SimoNOTE=/SIMOLIBR/LOGS/JESLOG_BASHUSER.txt
     if [ "$SIMONOTE" = "" ]
     then
       export SIMONOTE=SIMONOTE_JOBLOG_BASHUSER.txt
     fi
     echo $(date +'%Y/%m/%d') - $(date +'%r') $1>> $SIMONOTE
     echo $1

Table of Contents Previous Section Next Section Summary

This document describes and demonstrates how to access and process Record Sequential files with variable length records. The processing techniques include file create, convert, compare and view in a Hex Dump format. The COBOL programs that do the file format conversion and comparison were generated and tested using SIMOTIME Technology running on a Windows System with Micro Focus COBOL and a Linux (Ubuntu) System with GnuCOBOL. This document may be used as a tutorial for new programmers or as a quick reference for experienced programmers.

In the world of programming there are many ways to solve a problem. This document and the links to other documents are intended to provide a greater awareness of the Data Management and Application Processing alternatives.

The documentation and software were developed and tested on systems that are configured for a SIMOTIME environment based on the hardware, operating systems, user requirements and security requirements. Therefore, adjustments may be needed to execute the jobs and programs when transferred to a system of a different architecture or configuration.

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please send an e-mail to: helpdesk@simotime.com or call 415 883-6565. We appreciate hearing from you.

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 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 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.

This suite of programs and documentation is available to download for review and evaluation purposes. Other uses will require a SIMOTIME Software License. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

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 and services available from Micro Focus. This link requires an Internet Connection.

Explore the COBOL 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 Comments or Feedback

This document was created and is copyrighted and maintained by SimoTime Technologies.

If you have any questions, suggestions, comments or feedback please call or send an e-mail to: helpdesk@simotime.com

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 or need assistance with converting non-relational data structures simply give us a call at 415 883-6565 or check the web site at http://www.simotime.com


Return-to-Top
Record Sequential to ASCII/Text, File Convert using Variable Length Records
Copyright © 1987-2018
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com