Variable Length Records
Micro Focus COBOL & File Formats
  Table of Contents  v-24.01.01 - cblvlr01.htm 
  Introduction
  Program Objectives
  Program Input and Output
  Program Requirements
  Program Overview & Logic Diagram
  The Command Files
  Create the ALPHA Test Files
  File Format & Content Conversions
  Hex Dump Utility for a ZOS/V File
  The COBOL Programs
  Compare the Files
  Convert the Files
  Fixed/80 RSEQ to Variable z4-32760
  Variable z4-32760 to Variable v4-32760
  Variable v4-32760 to Variable z4-32760/EBC
  Variable z4-32760 to Fixed/80 RSEQ
  Fixed/80 RSEQ to ASCII/Text
  Variable v4-32760 to ASCII/Text
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Contact or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This suite of programs provides examples that will create, access and convert sequential files that use variable-length-records.

Sequential Fixed-Length-Record
May be downloaded from the Mainframe using the "BINARY MODE" of File-Transfer-Protocol (FTP) and accessed in a Micro Focus COBOL environment using the CHARSET(EBCDIC) compiler directive.
Note: the IBMCOMP and NOTRUNC compiler directives may be required if the records contain numeric fields with a BINARY or COMPUTATIONAL format.
Sequential Variable-Length-Record
May be downloaded from the Mainframe using the "BINARY MODE" of File-Transfer-Protocol (FTP) but must be converted to a Micro Focus format for Variable-Record-Length to process in the Windows (or UNIX) environment. The CHARSET(EBCDIC) directive will be required.
Note: the IBMCOMP and NOTRUNC directives may be required.
INDEXED Variable-Length-Record
Must be copied to a SEQUENTIAL file format prior to downloading with File-Transfer-Protocol (FTP) and recreated as a Micro Focus Key-Sequenced file in the Windows (or UNIX) environment. The CHARSET(EBCDIC) directive will be required.
Note: the IBMCOMP and NOTRUNC directives may be required.
  File Types with Transfer and Convert Description

In the preceding table the use of the CHARSET(EBCDIC) directive with IBMCOMP and NOTRUNC directives are referenced as requirements. The scope of effort required to translate the records between EBCDIC and ASCII is directly proportional to the number and location of the Signed-Numeric, Packed and Binary fields. Additional complexities are introduced if "REDEFINES" and "OCCURS DEPENDING ON" capabilities are used. With the CHARSET(EBCDIC) directive it is not necessary to do ASCII/EBCDIC translation.

The source code for the COBOL programs is written to be compiled in a Micro Focus environment on a Windows platform. Windows Command (.CMD) files are provided to run the jobs on a PC with Micro Focus Net Express.


We have made a significant effort to ensure the documents and software technologies are correct and accurate. We reserve the right to make changes without notice at any time. The function delivered in this version is based upon the enhancement requests from a specific group of users. The intent is to provide changes as the need arises and in a timeframe that is dependent upon the availability of resources.

Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved

Table of Contents Previous Section Next Section Program Objectives

The following is a list of the functions provided in this example.

Item Description
1 Demonstrate how to read an ASCII/TEXT file and create a fixed-record-length, sequential file with EBCDIC data.
2 Demonstrate how to read the fixed-record-length, sequential file with EBCDIC data and create a variable-record-length, sequential file with EBCDIC data.
3 Demonstrate how to read the variable-record-length, sequential file with EBCDIC data and create a fixed-record-length, sequential file with EBCDIC data.
4 Demonstrate how to read the fixed-record-length, sequential file with EBCDIC data and create an ASCII/TEXT file.
5 Demonstrate how to compare the contents of two data files.
  Describe Various File Access Methods and Data Conversion Techniques

Table of Contents Previous Section Next Section Program Input and Output

The primary input data is created by executing the CRTALFE1.cmd Windows command file. Next, a multi-step job is used to describe and demonstrate various file conversions of sequential files with variable length records. The output of one step becomes the input to the next step. The sequence of file conversion steps will eventually create a file that should be equal in content and format as the primary input file. The two files are compared and this should produce an equal result.

Table of Contents Previous Section Next Section Program Requirements

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

1 Executes on Windows/XP, Windows/7 or Windows Server using Micro Focus Server or Micro Focus Studio.
2 May be ported to run on the Linux or UNIX platforms supported by Micro Focus.
3 This suite of programs will make calls to common utility programs and callable routines that a available from SimoTime. Therefore, the SIMOMODS technologies or the SimoTime "Enterprise Application Support and Data Management Technologies" will be required.
  Operating Systems and Supporting Software for Program Execution

Table of Contents Previous Section Next Section Program Overview & Logic Diagram

The following diagram is an overview of how the demonstration programs fit into the example.

             
CBLVLRE1
cmd
   
   
 
 
 
 
   
   
   
   
Call
 
 
   
   
 
Step 1, Call a Windows Command File
   
   
   
ENV1BASE
cmd
Set the Environment.
   
   
   
Call
 
 
   
   
 
Step 2, Call a Windows Command File
   
   
   
CRTALFE1
cmd
 
 
ALPHALS1
lseq
Create an ASCII/Text file using instream data.
   
   
   
ALPHALS1
lseq
 
 
CV80ALAR
cobol
ALPHARSA
lseq
Read ASCII/Text and create a RSEQ-Fixed-80 , ASCII file.
   
   
   
ALPHALS1
lseq
 
 
CV80ALER
cobol
 
 
ALPHARSE
lseq
Read ASCII/Text and create a RSEQ-Fixed-80, EBCDIC file.
   
   
   
Run
 
 
   
   
 
Step 3, Run a Micro Focus COBOL Program
   
   
   
ALPHALSE
lseq
 
 
CBLVLRC2
cobol
Read RSEQ-Fixed-80, EBCDIC.
   
   
   
SIMOBSIO
cobol
 
 
ALPHAZ01
z4-32760
Write Mainframe RSEQ-Variable-4-32760, EBCDIC using BSIO.
   
   
   
Run
 
 
   
   
 
Step 4, Run a Micro Focus COBOL Program
   
   
   
CBLVLRC3
cobol
 
 
ALPHAV01
v4-32760
Create Micro Focus RSEQ-Variable-4-32760, EBCDIC.
   
   
   
ALPHAZ01
z4-32760
 
 
SIMOBSIO
cobol
Read Mainframe RSEQ-Variable-4-32760, EBCDIC using BSIO,
   
   
   
Run
 
 
   
   
 
Step 5, Run a Micro Focus COBOL Program
   
   
   
ALPHAV01
v4-32760
 
 
CBLVLRC4
cobol
Read Micro Focus RSEQ-Variable-4-32760, EBCDIC.
   
   
   
SIMOBSIO
cobol
 
 
ALPHAZ02
z4-32760
Create Mainframe RSEQ-Variable-4-32760, EBCDIC using BSIO.
   
   
   
Run
 
 
   
   
 
Step 6, Run a Micro Focus COBOL Program
   
   
   
CBLVLRC5
cobol
 
 
ALPHARS2
rseq
Create Micro Focus RSEQ-80, EBCDIC.
   
   
   
ALPHAZ02
z4-32760
 
 
SIMOBSIO
cobol
Read Mainframe RSEQ-Variable-4-32760, EBCDIC using BSIO,
   
   
   
Run
 
 
   
   
 
Step 7, Run a Micro Focus COBOL Program
   
   
   
ALPHARS2
rseq
CBLVLRC6
cobol
 
 
ALPHALS2
lseq
Read RSEQ-Fixed-80 -EBCDIC, write ASCII/Text.
   
   
   
Run
 
 
   
   
 
Step 8, Run a Micro Focus COBOL Program
   
   
   
ALPHALS1
lseq
   
   
CBLVLRC1
cobol
 
 
SYSOUT
spool
Compare the ASCII/Text Files
   
   
   
ALPHALS2
lseq
   
   
   
   
   
Run
 
 
   
   
 
Step 9, Run a Micro Focus COBOL Program
   
   
   
ALPHAV01
z4-32760
CBLVLRC7
cobol
 
 
ALPHALS3
lseq
Read Micro Focus RSEQ-Variable-4-32760, EBCDIC, write LSEQ ASCII Variable.
   
   
   
Run
 
 
   
   
 
Step 10, Run a Micro Focus COBOL Program
   
   
   
ALPHALS1
lseq
   
   
CBLVLRC1
cobol
 
 
SYSOUT
spool
Compare the ASCII/Text Files
   
   
   
ALPHALS3
lseq
   
   
   
   
 
 
 
 
   
   
EOJ
 
Logic Flow for Various File Create, Convert and Compare Tasks

Color Associations: The  light-green  boxes are unique to SIMOTIME Technologies using an IBM Mainframe System or Micro Focus Enterprise Developer. The  light-red  boxes are unique to the SIMOTIME Technologies using a Linux, UNIX or Windows System and COBOL Technologies such as Micro Focus. The  light-yellow  boxes are SIMOTIME Technologies, Third-party Technologies, decision points or program transitions in the processing logic or program generations. The  light-blue  boxes identify the input/output data structures such as Documents, Spreadsheets, Data Files, VSAM Data Sets, Partitioned Data Set Members (PDSM's) or Relational Tables. The  light-gray  boxes identify a system function or an informational item.

Table of Contents Previous Section Next Section The Command Files

This example has three (3) Windows Command Files. The 1st CMD File is used to create the three (3) files used as a base for the conversion and comparison examples. The 2nd CMD File does a number of file format and file content conversions. File compares are done at the end of the conversion steps. The 3rd CMD File is used to view the contents of the ZOS formatted file in a hexadecimal dump format.

Table of Contents Previous Section Next Section Create the ALPHA Test Files

The following is the Windows Command file (CRTALFE1.cmd) required to create the three primary files used in this example.

@echo OFF
rem  * *******************************************************************
rem  *               CRTALFE1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text   - Create a Sequential Data Set on disk using ECHO function.
rem  * Author - SimoTime Technologies
rem  * Date   - January 24, 1996
rem  *
rem  * The 1st step will delete any previously created file.
rem  *
rem  * The 2nd step will created a new TEXT file. This step will use the
rem  * Windows ECHO with instream data.
rem  *
rem  * The 3rd step will read the text file and convert to a Record
rem  * sequential file of ASCII-encoded, fixed-length, eighty-byte records.
rem  * A COBOL program is used to do the File Format conversion.
rem  *
rem  * The 4th step will read the text file and convert to a Record
rem  * sequential file of EBCDIC-encoded, fixed-length, eighty-byte records.
rem  * A COBOL program is used to do the File Format and File Content
rem  * conversion.
rem  *
rem  * This set of programs will run on a Personal Computer with
rem  * Windows and Micro Focus Net Express.
rem  * ********************************************************************
rem  * Step   1 of 2  Set the global environment variables,
rem  *                Delete any previously created file...
rem  *
     call ..\Env1BASE
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set TaskName=CRTALFE1
rem  *
     call SimoNOTE "*--------------------------------------------------------------*%TaskName%"
     call SimoNOTE "Starting TaskName %TaskName%"
     call SimoNOTE "Identify TaskStep DeleteAsciiText"
     set ALPHALS1=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS1.TXT
     if exist %ALPHALS1% del %ALPHALS1%
rem  *
rem  * *******************************************************************
rem  * Step   2 of 2  Create and populate a new TEXT file...
rem  *
:CreateAsciiText
     call SimoNOTE "Identify TaskStep CreateAsciiText"
rem  *...:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....8
echo 000000000001 A>>%ALPHALS1%
echo 000000000002 AB>>%ALPHALS1%
echo 000000000003 ABC>>%ALPHALS1%
echo 000000000004 ABCD>>%ALPHALS1%
echo 000000000005 ABCDE>>%ALPHALS1%
echo 000000000006 ABCDEF>>%ALPHALS1%
echo 000000000007 ABCDEFG>>%ALPHALS1%
echo 000000000008 ABCDEFGH>>%ALPHALS1%
echo 000000000009 ABCDEFGHI>>%ALPHALS1%
echo 000000000010 ABCDEFGHIJ>>%ALPHALS1%
echo 000000000011 ABCDEFGHIJK>>%ALPHALS1%
echo 000000000012 ABCDEFGHIJKL>>%ALPHALS1%
echo 000000000013 ABCDEFGHIJKLM>>%ALPHALS1%
echo 000000000014 ABCDEFGHIJKLMN>>%ALPHALS1%
echo 000000000015 ABCDEFGHIJKLMNO>>%ALPHALS1%
echo 000000000016 ABCDEFGHIJKLMNOP>>%ALPHALS1%
echo 000000000017 ABCDEFGHIJKLMNOPR>>%ALPHALS1%
echo 000000000018 ABCDEFGHIJKLMNOPQR>>%ALPHALS1%
echo 000000000019 ABCDEFGHIJKLMNOPQRS>>%ALPHALS1%
echo 000000000020 ABCDEFGHIJKLMNOPQRST>>%ALPHALS1%
echo 000000000021 ABCDEFGHIJKLMNOPQRSTU>>%ALPHALS1%
echo 000000000022 ABCDEFGHIJKLMNOPQRSTUV>>%ALPHALS1%
echo 000000000023 ABCDEFGHIJKLMNOPQRSTUVW>>%ALPHALS1%
echo 000000000024 ABCDEFGHIJKLMNOPQRSTUVWX>>%ALPHALS1%
echo 000000000025 ABCDEFGHIJKLMNOPQRSTUVWXY>>%ALPHALS1%
echo 000000000026 ABCDEFGHIJKLMNOPQRSTUVWXYZ>>%ALPHALS1%
echo 000000000027 ABCDEFGHIJKLMNOPQRSTUVWZXZabcdefghijklmnopqrstuvwxtz1234567890>>%ALPHALS1%
echo 000000000028 ABCDEFGHIJKLMNOPQRSTUVWXYZ>>%ALPHALS1%
echo 000000000029 ABCDEFGHIJKLMNOPQRSTUVWXY>>%ALPHALS1%
echo 000000000030 ABCDEFGHIJKLMNOPQRSTUVWX>>%ALPHALS1%
echo 000000000031 ABCDEFGHIJKLMNOPQRSTUVW>>%ALPHALS1%
echo 000000000032 ABCDEFGHIJKLMNOPQRSTUV>>%ALPHALS1%
echo 000000000033 ABCDEFGHIJKLMNOPQRSTU>>%ALPHALS1%
echo 000000000034 ABCDEFGHIJKLMNOPQRST>>%ALPHALS1%
echo 000000000035 ABCDEFGHIJKLMNOPQRS>>%ALPHALS1%
echo 000000000036 ABCDEFGHIJKLMNOPQR>>%ALPHALS1%
echo 000000000037 ABCDEFGHIJKLMNOPQ>>%ALPHALS1%
echo 000000000038 ABCDEFGHIJKLMNOR>>%ALPHALS1%
echo 000000000039 ABCDEFGHIJKLMNO>>%ALPHALS1%
echo 000000000040 ABCDEFGHIJKLMN>>%ALPHALS1%
echo 000000000041 ABCDEFGHIJKLM>>%ALPHALS1%
echo 000000000042 ABCDEFGHIJKL>>%ALPHALS1%
echo 000000000043 ABCDEFGHIJK>>%ALPHALS1%
echo 000000000044 ABCDEFGHIJ>>%ALPHALS1%
echo 000000000045 ABCDEFGHI>>%ALPHALS1%
echo 000000000046 ABCDEFGH>>%ALPHALS1%
echo 000000000047 ABCDEFG>>%ALPHALS1%
echo 000000000048 ABCDEF>>%ALPHALS1%
echo 000000000049 ABCDE>>%ALPHALS1%
echo 000000000050 ABCD>>%ALPHALS1%
echo 000000000051 ABC>>%ALPHALS1%
echo 000000000052 AB>>%ALPHALS1%
echo 000000000053 A>>%ALPHALS1%
echo 000000000054 a>>%ALPHALS1%
echo 000000000055 ab>>%ALPHALS1%
echo 000000000056 abc>>%ALPHALS1%
echo 000000000057 abcd>>%ALPHALS1%
echo 000000000058 abcde>>%ALPHALS1%
echo 000000000059 abcdef>>%ALPHALS1%
echo 000000000060 abcdefg>>%ALPHALS1%
echo 000000000061 abcdefgh>>%ALPHALS1%
echo 000000000062 abcdefghi>>%ALPHALS1%
echo 000000000063 abcdefghij>>%ALPHALS1%
echo 000000000064 abcdefghijk>>%ALPHALS1%
echo 000000000065 abcdefghijkl>>%ALPHALS1%
echo 000000000066 abcdefghijklm>>%ALPHALS1%
echo 000000000067 abcdefghijklmn>>%ALPHALS1%
echo 000000000068 abcdefghijklmno>>%ALPHALS1%
echo 000000000069 abcdefghijklmnop>>%ALPHALS1%
echo 000000000070 abcdefghijklmnopr>>%ALPHALS1%
echo 000000000071 abcdefghijklmnopqr>>%ALPHALS1%
echo 000000000072 abcdefghijklmnopqrs>>%ALPHALS1%
echo 000000000073 abcdefghijklmnopqrst>>%ALPHALS1%
echo 000000000074 abcdefghijklmnopqrstu>>%ALPHALS1%
echo 000000000075 abcdefghijklmnopqrstuv>>%ALPHALS1%
echo 000000000076 abcdefghijklmnopqrstuvw>>%ALPHALS1%
echo 000000000077 abcdefghijklmnopqrstuvwx>>%ALPHALS1%
echo 000000000078 abcdefghijklmnopqrstuvwxy>>%ALPHALS1%
echo 000000000079 abcdefghijklmnopqrstuvwxyz>>%ALPHALS1%
echo 000000000080 abcdefghijklmnopqrstuvwzxz0123456789>>%ALPHALS1%
echo 000000000081 abcdefghijklmnopqrstuvwxyz>>%ALPHALS1%
echo 000000000082 abcdefghijklmnopqrstuvwxy>>%ALPHALS1%
echo 000000000083 abcdefghijklmnopqrstuvwx>>%ALPHALS1%
echo 000000000084 abcdefghijklmnopqrstuvw>>%ALPHALS1%
echo 000000000085 abcdefghijklmnopqrstuv>>%ALPHALS1%
echo 000000000086 abcdefghijklmnopqrstu>>%ALPHALS1%
echo 000000000087 abcdefghijklmnopqrst>>%ALPHALS1%
echo 000000000088 abcdefghijklmnopqrs>>%ALPHALS1%
echo 000000000089 abcdefghijklmnopqr>>%ALPHALS1%
echo 000000000090 abcdefghijklmnopq>>%ALPHALS1%
echo 000000000091 abcdefghijklmnor>>%ALPHALS1%
echo 000000000092 abcdefghijklmno>>%ALPHALS1%
echo 000000000093 abcdefghijklmn>>%ALPHALS1%
echo 000000000094 abcdefghijklm>>%ALPHALS1%
echo 000000000095 abcdefghijkl>>%ALPHALS1%
echo 000000000096 abcdefghijk>>%ALPHALS1%
echo 000000000097 abcdefghij>>%ALPHALS1%
echo 000000000098 abcdefghi>>%ALPHALS1%
echo 000000000099 abcdefgh>>%ALPHALS1%
echo 000000000100 abcdefg>>%ALPHALS1%
echo 000000000101 abcdef>>%ALPHALS1%
echo 000000000102 abcde>>%ALPHALS1%
echo 000000000103 abcd>>%ALPHALS1%
echo 000000000104 abc>>%ALPHALS1%
echo 000000000105 ab>>%ALPHALS1%
echo 000000000106 a>>%ALPHALS1%
     if not exist %ALPHALS1% set JobStatus=0020
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "DataMake ALPHALS1=%ALPHALS1%"
rem  *
:ConvertLSEQtoRSEQasc
rem  *
rem  * *******************************************************************
rem  * Step 3, Read the previously created Line Sequential File (LSEQ)
rem  *         and write a Record Sequential File (RSEQ) with 80-byte,
rem  *         ASCII-encoded records.
rem  *
     call SimoNOTE "Identify TaskStep ConvertLSEQtoRSEQasc"
     set GETLS080=%ALPHALS1%
     set PUTRS080=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHARSA.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALAR
     if not exist %PUTRS080% set JobStatus=0030
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "DataTake GETLS080=%GETLS080%"
     call SimoNOTE "DataMake PUTRS080=%PUTRS080%"
rem  *
:ConvertLSEQtoRSEQebc
rem  *
rem  * *******************************************************************
rem  * Step 4, Read the previously created Line Sequential File (LSEQ)
rem  *         and write a Record Sequential File (RSEQ) with 80-byte,
rem  *         EBCDIC-encoded records.
rem  *
     call SimoNOTE "Identify TaskStep ConvertLSEQtoRSEQebc"
     set GETLS080=%ALPHALS1%
     set PUTRS080=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHARSE.DAT
     if exist %PUTRS080% del %PUTRS080%
     run CV80ALER
     if not exist %PUTRS080% set JobStatus=0040
     if not "%JobStatus%" == "0000" goto EojNok
     call SimoNOTE "DataTake GETLS080=%GETLS080%"
     call SimoNOTE "DataMake PUTRS080=%PUTRS080%"
:EojAok
     call SimoNOTE "Finished TaskName %TaskName%, Job Status is %JobStatus%"
     goto :End
:EojNok
     call SimoNOTE "ABENDING TaskName %TaskName%, Job Status is %JobStatus%"

:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section File Format & Content Conversions

The following is the command file (CBLVLRE1.cmd) that is used to do the various file conversions and comparisons.

@echo OFF
rem  * *******************************************************************
rem  *               CBLVLRE1.cmd - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Data File Conversion, Variable Length Records
rem  * Author  - SimoTime Technologies
rem  * Date    - May 04, 2004
rem  * Version - 04.03.12
rem  *
rem  * This set of programs illustrate how to port a file with variable
rem  * length records to a Micro Focus platform using Net Express.
rem  *
rem  * When running with Net Express the IBMCOMP an NOTRUNC directives
rem  * will be required to maintain compatability with the mainframe
rem  * format and field sizes for binary fields.
rem  *
rem  * This set of programs will run on a Personal Computer with Windows
rem  * and Micro Focus Net Express.
rem  *
rem  * With two eceptions the files are processed using the standard COBOL
rem  * coding techniques with the SELECT and FD statements. The two
rem  * exceptions are the mainframe image files (FTEDBV01 and FTEDBV02)
rem  * files that are variable length records. These files are processed
rem  * using the Micro Focus Byte-Stream-Input-Output (BSIO) access method.
rem  * The mainframe image files may also be downloaded from the mainframe
rem  * using FTP and MODE BINARY.
rem  *
rem  * ********************************************************************
rem  * Step 1 of 10, Set the common environment variables...
rem  *
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set CmdName=CblVlrE1
     call ..\Env1BASE
rem  *
     call SimoNOTE "**********************************************************************%CmdName%"
     call SimoNOTE "Starting CmdName  %CmdName%"
rem  * ********************************************************************
rem  * Step 2 of 10, Create the ALPHA Files...
rem  *
     call SimoNOTE "Identify JobStep  Create the Alpha Files"
     call CrtAlfE1 nopause
rem  * ********************************************************************
rem  * Step 3 of 10, Read RSEQ, EBCDIC, 80 and write ZOS Variable 4-32760
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read RSEQ, EBCDIC, Fixed-80 and write ZOS Variable 4-32760"
     set ALPHARSE=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHARSE.DAT
     set BSIODSN1=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAZ01.ZOS
     set BSIOFMT1=V
     run CblVlrC2
     if ERRORLEVEL = 1 set JobStatus=0030
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake ALPHARSE=%ALPHARSE%"
     call SimoNOTE "DataMake BSIODSN1=%BSIODSN1%"
rem  * ********************************************************************
rem  * Step   4 of 10  Read ZOS Variable and write MF Variable...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read ZOS Variable 4-32760 and write MF Variable 4-32760"
     set BSIODSN1=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAZ01.ZOS
     set ALPHAV01=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAV01.DAT
     run CblVlrC3
     if ERRORLEVEL = 1 set JobStatus=0040
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake BSIODSN1=%BSIODSN1%"
     call SimoNOTE "DataMake ALPHAV01=%ALPHAV01%"
rem  * ********************************************************************
rem  * Step   5 of 10  Read MF Variable and write ZOS Variable...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read MF Variable 4-32760 and write ZOS Variable 4-32760"
     set ALPHAV01=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAV01.DAT
     set BSIODSN2=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAZ02.ZOS
     set BSIOFMT1=V
     run CblVlrC4
     if ERRORLEVEL = 1 set JobStatus=0050
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake ALPHAV01=%ALPHAV01%"
     call SimoNOTE "DataMake BSIODSN2=%BSIODSN2%"
rem  * ********************************************************************
rem  * Step   6 of 10  Read ZOS Variable and write SEQUENTIAL Fixed...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read ZOS Variable 4-32760 and write RSEQ EBCDIC Fixed-80"
     set BSIODSN2=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAZ02.ZOS
     set ALPHARS2=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHARS2.DAT
     run CblVlrC5
     if ERRORLEVEL = 1 set JobStatus=0060
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake BSIODSN2=%BSIODSN2%"
     call SimoNOTE "DataMake ALPHARS2=%ALPHARS2%"
rem  * ********************************************************************
rem  * Step   7 of 10  Read SEQUENTIAL-FIXED and write ASCII/Text...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read RSEQ EBCDIC Fixed-80 and write LSEQ ASCII Variable"
     set ALPHARS2=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHARS2.DAT
     set ALPHALS2=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS2.TXT
     run CblVlrC6
     if ERRORLEVEL = 1 set JobStatus=0070
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake ALPHARS2=%ALPHARS2%"
     call SimoNOTE "DataMake ALPHALS2=%ALPHALS2%"
rem  * ********************************************************************
rem  * Step   8  of 10  Compare ASCII/Text Files...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Compare ASCII/Text Files..."
     set LS80UT01=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS1.TXT
     set LS80UT02=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS2.TXT
     run CBLVLRC1
     if ERRORLEVEL = 1 set JobStatus=0080
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake LS80UT01=%LS80UT01%"
     call SimoNOTE "DataTake LS80UT02=%LS80UT02%"
rem  * ********************************************************************
rem  * Step   9 of 10  Read MF-VARABLE-EBCDIC and write ASCII/Text...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Read RSEQ EBCDIC Variable 4-32760, write LSEQ ASCII Variable"
     set ALPHAV01=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAV01.DAT
     set ALPHALS3=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS3.TXT
     run CblVlrC7
     if ERRORLEVEL = 1 set JobStatus=0090
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake ALPHAV01=%ALPHAV01%"
     call SimoNOTE "DataMake ALPHALS3=%ALPHALS3%"
rem  * ********************************************************************
rem  * Step   10 of 10  Compare ASCII/Text Files...
rem  *
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Annotate Compare ASCII/Text Files..."
     set LS80UT01=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS1.TXT
     set LS80UT02=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHALS3.TXT
     run CBLVLRC1
     if ERRORLEVEL = 1 set JobStatus=0100
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake LS80UT01=%LS80UT01%"
     call SimoNOTE "DataTake LS80UT02=%LS80UT02%"
:EojAOK
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "Finished CmdName  %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "*--------------------------------------------------------------------*"
     call SimoNOTE "ABENDING CmdName  %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Hex Dump Utility for a ZOS/V File

The following is the command file (CBLVLRX3.cmd) that is used to dump the first 10,000 bytes a ZOS formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes.

@echo OFF
rem  * *******************************************************************
rem  *               CBLVLRX3.CMD - a Windows Command File               *
rem  *         This program is provided by SimoTime Technologies         *
rem  *           (C) Copyright 1987-2019 All Rights Reserved             *
rem  *             Web Site URL:   http://www.simotime.com               *
rem  *                   e-mail:   helpdesk@simotime.com                 *
rem  * *******************************************************************
rem  *
rem  * Text    - Hex Dump of 1st 10,000 bytes of a file.
rem  * Author  - SimoTime Technologies
rem  * Date    - May 04, 2004
rem  * Version - 04.03.12
rem  *
rem  * This set of programs illustrate how to provide a hexdump
rem  * display of a file.
rem  *
rem  * This job uses the SIMOZAPS Utility program and the SIMOMODS
rem  * callable programs to dump the contents of file in a hexadecimal
rem  * format with possible ASCII and EBCDIC interpretations.
rem  *
rem  * The installation of the SimoTime Technologies will be required
rem  * to run this job.
rem  *
rem  * ********************************************************************
rem  * Step 1 of 3, Set the common environment variables...
rem  *
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
     set CmdName=CblVlrX3
     call ..\Env1BASE
rem  * Override SYSLOG for Hex Dump...
     set SYSLOG=%BASESYS%\LOGS\SYSLOG_HEXDUMP.TXT
     if exist %SYSLOG% erase %SYSLOG%
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName  %CmdName%"
rem  * ********************************************************************
rem  * Step 2 of 3, Hex-Dump of file...
rem  *
     call SimoNOTE "Identify JobStep  Hex-Dump of file"
     set BSIODSN1=%BaseLib1%\DATA\Wrk1\SIMOTIME.DATA.ALPHAZ01.ZOS
     run SIMOZAPS HEXCESS %BSIODSN1% View=1 stop=10000
     if ERRORLEVEL = 1 set JobStatus=0020
     if not "%JobStatus%" == "0000" goto :EojNOK
     call SimoNOTE "DataTake BSIODSN1=%BSIODSN1%"
     call SimoNOTE "DataMake SYSLOG=%SYSLOG%"
rem  * ********************************************************************
rem  * Step 3 of 3, Use NotePAD to display Hex-Dump of file...
rem  *
     if exist %SYSLOG% start NotePAD %SYSLOG%
:EojAOK
     call SimoNOTE "*------------------------------------------------------"
     call SimoNOTE "Finished CmdName  %CmdName%, Job Status is %JobStatus%"
     goto :End
:EojNOK
     call SimoNOTE "*------------------------------------------------------"
     call SimoNOTE "ABENDING CmdName  %CmdName%, Job Status is %JobStatus%"
     goto :End
:End
     call SimoNOTE "Conclude SysLog is %SYSLOG%"
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section The COBOL Programs

This suite of programs has seven (7) COBOL programs. One program is used to compare the ASCII/Text files and the remaining six programs do the various data file conversions. This suite of programs will make calls to common utility programs and callable routines that are available from SimoTime. Therefore, the "SIMOMODS Technologies" or the SimoTime "Enterprise Application Support and Data Management Technologies" will be required.

The following abbreviations are used to reference certain file types.

Abbreviation  Description
LSEQ Line Sequential File, by default this is typically an ASCII/Text File with record content being limited to text characters that are display or print
RSEQ Record Sequential File, record content may be ASCII or EBCDIC and numeric values may be display, packed or finary format
v4-32760 a Micro Focus record sequential file with variable length records varying in size from 4 to 32,760 bytes
z4-32760 a Mainframe (or ZOS) record sequential file with variable length records varying in size from 4 to 32,760 bytes

Table of Contents Previous Section Next Section Compare the Files

The COBOL source code (CBLVLRC1.cbl) for the program that compares two ASCII/Text files is available in a separate document.

Review the COBOL Source Code for the program that compares two data files.

Table of Contents Previous Section Next Section Convert the Files

The following six programs will perform various file format and record content conversions.

Table of Contents Previous Section Next Section Fixed/80 RSEQ to Variable z4-32760

The COBOL source code (CBLVLRC2.cbl) for the program that converts a record sequential file with 80 bytes fixed length records to a mainframe (or ZOS) formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes is available in a separate document.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Variable z4-32760 to Variable v4-32760

The COBOL source code (CBLVLRC3.cbl) for the program that converts a Mainframe (or ZOS) formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Micro Focus Sequential file with variable length records with the size varying from 4 to 32,760 bytes.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Variable v4-32760 to Variable z4-32760/EBC

The COBOL source code (CBLVLRC4.cbl) for the program that converts a Micro Focus formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Mainframe (or ZOS) Sequential file with variable length records with the size varying from 4 to 32,760 bytes.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Variable z4-32760 to Fixed/80 RSEQ

The COBOL source code (CBLVLRC5.cbl) for the program that converts a Mainframe (or ZOS) formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Micro Focus Record Sequential file with fixed length records with a record size of 80 bytes.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Fixed/80 RSEQ to ASCII/Text

The COBOL source code (CBLVLRC6.cbl) for the program that converts a Record Sequential file formatted with fixed length 80 byte records to a Micro Focus Line Sequential (or ASCII/Text) file with fixed length records with a record size of 80 bytes.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Variable v4-32760 to ASCII/Text

The COBOL source code (CBLVLRC7.cbl) for the program that converts a Micro Focus formatted sequential file with variable length records with the size varying from 4 to 32,760 bytes to a Micro Focus Line Sequential (or ASCII/Text) file with a maximum record size of 80 bytes.

Review the COBOL Source Code for this conversion program.

Table of Contents Previous Section Next Section Summary

This document may be used to assist as a tutorial for new programmers or as a quick reference for experienced programmers.

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

SIMOTIME Services has experience in moving or sharing data or application processing across a variety of systems. For additional information about SIMOTIME Services or Technologies please contact us using the information in the  Contact or Feedback  section of this document.

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 sub-section requires an Internet connection, the second sub-section references locally available documents.

Note: A SIMOTIME License is required for the items to be made available on a local server.

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.

Link to Internet   Link to Server   Explore 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.

Link to Internet   Link to Server   Explore How to FTP (using BINARY mode) a File with Variable Length Records from a Mainframe System to a Windows System and then convert the Mainframe format to a Micro Focus format. The mainline program will call the SIMOVREC and SIMOBSIO modules that are available from SimoTime in a separate package.

Link to Internet   Link to Server   Explore The ASCII and EBCDIC Translation Tables. These tables are provided for individuals that need to better understand the bit structures and differences of the encoding formats.

Link to Internet   Link to Server   Explore The File Status Return Codes that are used to interpret the results of accessing VSAM data sets and/or QSAM files.

Link to Internet   Link to Server   Explore the File Formats and various Numeric Formats being used in a multi-system complex consisting of Mainframe (z/OS), Linux, UNIX or Windows systems.

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 for download. Link to an Evaluation zPAK Option that includes the program members, documentation and control files.

Explore The Micro Focus Web Site for more information about products (including Micro Focus COBOL) and services available from Micro Focus. This link requires an Internet Connection.

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

Table of Contents Previous Section Next Section Glossary of Terms

Link to Internet   Link to Server   Explore the Glossary of Terms for a list of terms and definitions used in this suite of documents and white papers.

Table of Contents Previous Section Next Section Contact or Feedback

This document was created and is maintained by SimoTime Technologies. If you have any questions, suggestions, comments or feedback please use the following contact information.

1. Send an e-mail to our helpdesk.
1.1. helpdesk@simotime.com.
2. Our telephone numbers are as follows.
2.1. 1 415 763-9430 office-helpdesk
2.2. 1 415 827-7045 mobile

 

We appreciate hearing from you.

Table of Contents Previous Section Next Section Company Overview

SimoTime Technologies was founded in 1987 and is a privately owned company. We specialize in the creation and deployment of business applications using new or existing technologies and services. We have a team of individuals that understand the broad range of technologies being used in today's environments. Our customers include small businesses using Internet technologies to corporations using very large mainframe systems.

Quite often, to reach larger markets or provide a higher level of service to existing customers it requires the newer Internet technologies to work in a complementary manner with existing corporate mainframe systems. We specialize in preparing applications and the associated data that are currently residing on a single platform to be distributed across a variety of platforms.

Preparing the application programs will require the transfer of source members that will be compiled and deployed on the target platform. The data will need to be transferred between the systems and may need to be converted and validated at various stages within the process. SimoTime has the technology, services and experience to assist in the application and data management tasks involved with doing business in a multi-system environment.

Whether you want to use the Internet to expand into new market segments or as a delivery vehicle for existing business functions simply give us a call or check the web site at http://www.simotime.com


Return-to-Top
Sequential Files with Variable Length Records using COBOL
Copyright © 1987-2025
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com