Data File Conversion
Generate Data Conversion Programs
  Table of Contents  v-16.01.01 - utconv01.htm 
  Introduction
  Programming Requirements
  Programming Overview
  Basic Functionality
  The Command File, EZUTCONV
  The Process Control File
  Ancillary Functions
  Set the Environment
  Display and Log Messages
  Possibilities and Considerations
  Impact of Record Content Conversion
  Confusion Factors, How & What To Do
  Factor Zero, Minimum Confusion
  1. Records Contain Packed or Binary Fields
  2. Spaces Allowed in Packed Fields
  3. Convert File Format & Record Content
  4. Convert KSDS-FFL to ASCII-Text-CSV
  5. Code Page & High-Values or x'FF'
  6. Sequence of EBCDIC & ASCII
  Technical Details
  Convert Tables, without Umlaut-Y
  Convert Tables, Signed Zoned Decimal
  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

SimoTime Technologies has a library of programs that do data file conversions between various file formats, record content and record structures. For example, SimoTime can do a file format conversion between a record sequential file and a Micro Focus Key-Sequenced-Data-Set or a record content conversion between EBCDIC and ASCII encoding schemas. An optional item is the creation of HTML Documentation for the record layouts based on a COBOL copy file.

Many companies are looking for ways to transfer, share, convert and/or compare data files between a mainframe system and a distributed system (i.e. Linux, UNIX and/or Windows or "LUW") running Micro Focus sub-systems. This utility program (UTCONVRT) is intended to assist in these efforts.

The UTCONVPE utility is a "pre-edit and execute" program that runs on a Windows System with Micro Focus Enterprise Developer and generates conversion programs (COBOL Source Code) that may be compiled and executed on a distributed LUW platform with Micro Focus or an IBM Mainframe System. The UTCONVPE program is capable of generating programs that do File Format, Record Format and Record Content Conversion. UTCONVPE does this by performing a pre-edit of the user specifications and then executes other SimoTime technologies to generate the programs that will do the actual conversion.


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

Table of Contents Previous Section Next Section Programming Requirements

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

System Description
Mainframe COBOL for OS/390 or later should be used (this provided for Y2K compliance) to compile the generated source code.
Note: the SimoTime Utility program has the capability of generating COBOL Source code that can convert ASCII/Text (or LINE SEQUENTIAL) files. Programs that are generated with Line Sequential dependencies will not compile and execute in the ZOS environment of an IBM Mainframe.
Windows To compile and execute the generated COBOL programs the Micro Focus Studio is recommended. However, Net Express and Mainframe Express may be used. Once a program is compiled with Micro Focus Studio it may be executed using Micro Focus Server.
Note: the SimoTime Utility program and the generated test cases are tested on Windows/XP, Windows/7 and Windows Server using Micro Focus Studio, version 6.0 and/or later.
Linux To compile and execute the generated COBOL programs the Micro Focus Server Express is recommended. Once a program is compiled with Micro Focus Server Express it may be executed using Micro Focus Server.
UNIX To compile and execute the generated COBOL programs the Micro Focus Server Express is recommended. Once a program is compiled with Micro Focus Server Express it may be executed using Micro Focus Server.
  System Possibilities for Generated Data File Convert Programs

Table of Contents Previous Section Next Section Programming Overview

The following is a flowchart of the job that executes the process to generate programs that do data file conversion.

                 
UTCONVL1
lseq
 
 
UTCONVE1
cmd
Start the Job
   
   
   
   
   
   
if &SIMOPREP
 
 
call
 
 
   
   
   
SIMOPREP
cmd
Set the System (or global) environment variables
   
   
if &USERPREP
 
 
call
 
 
   
   
   
USERPREP
cmd
Set the User (or job specific) environment variables
   
   
   
   
Entry TAG-A
 
 
for /F do LOOP
Read a file of a list of member names
   
   
   
 
 
Yes
 
 
End-of-List?
 
 
No
 
 
SIMOCONV
cmd
Process each name in the list
   
   
   
 
 
 
 
   
   
   
   
   
Run
 
 
   
   
   
   
   
   
   
UTCONVD1
PCF
 
 
UTCONVRT
cbl
   
   
UTCONVD2genr
cmd
Read the Process Control file,
create CMD and Specification file
   
   
   
   
   
   
   
UTCONVD3spec
txt
Specifications File
   
   
   
If Job-Status=0
 
 
Yes
 
 
UTCONVD2genr
cmd
Execute the newly created CMD file,
generate the conversion program
   
No
   
   
ABEND
   
   
   
   
 
 
 
 
   
   
   
   
   
If &HTMLFILE
 
 
call
 
 
   
   
   
   
   
   
   
member-name
CPY
 
 
REC1HTML
cmd
 
 
member-name
HTM
Generate the HTML Document
   
   
   
   
   
If &PROGID
 
 
call
 
 
   
   
   
   
   
   
   
UTCONVD3spec
TXT
 
 
ZAPSREC1
cmd
   
   
&PROGID
CBL
Generate program for Data File I/O and Call-to-Convert
   
   
   
   
   
   
 
 
 
 
   
   
   
   
&TRANSCALL
CBL
Generate the Record Content Conversion program
   
GOTO TAG-A
   
   
 
 
   
   
EOJ
 
The Process to Generate Programs that do Data File Conversion

Table of Contents Previous Section Next Section Basic Functionality

This section will focus on the primary CMD Files that do the actual processing of the Procedural files that define the process and parameters to do a user defined data file conversion. The primary CMD Files will call other command files to perform ancillary tasks. These secondary command files and programs will be described in the Ancillary Functionality section of this document.

Table of Contents Previous Section Next Section The Command File, EZUTCONV

The following is the Windows Command file (EZUTCONV.cmd) that will process a single procedural script to do a data file conversion.

@echo OFF
rem  * Set the environment variable to use the default directives file.
     set CmdName=ezUTCONV
     call USERCONV
     call SimoNOTE "***********************************************************************%CmdName%"
     call SimoNOTE "Starting %CmdName% Preparation, RC=%ConvertStatus%, PGM=%1"
     set ConvertStatus=0000
     set UTCONVD1=%UTGENGET%\%1proc.PRC
     set UTCONVD2=%UTGENGET%\%1genr.CMD
     set UTCONVD3=%UTGENGET%\%1spec.TXT
     if exist %UTCONVD2% erase %UTCONVD2%
     if exist %UTCONVD3% erase %UTCONVD3%
     call SimoNOTE "*---------------------------------------------------------------------*"
     call SimoNOTE "Starting %CmdName% Generation, RC=%ConvertStatus%, PGM=%1"
     run UTCONVRT
     if not "%ERRORLEVEL%" == "0" set ConvertStatus=0010
     if not "%ConvertStatus%" == "0000" goto :ConvertEojNOK
rem  *
rem  * ************************************************************************
:ConvertEojAOK
     set /A AOK_Count=%AOK_Count% + 1
     call SimoNOTE "*---------------------------------------------------------------------*"
     call SimoNOTE "Starting %CmdName% Execution, RC=%ConvertStatus%, PGM=%1"
     call %1genr
     if not "%ERRORLEVEL%" == "0" set ConvertStatus=0020
     if not "%ConvertStatus%" == "0000" goto :ConvertEojNOK
     call SimoNOTE "Complete %CmdName%, RC=%ConvertStatus%, PGM=%1"
     goto :End
rem  *
rem  * ************************************************************************
:ConvertEojNOK
     set JobStatus=%ConvertStatus%
     set /A NOK_Count=%NOK_Count% + 1
     call SimoNOTE "ABENDING %CmdName%, RC=%ConvertStatus%, PGM=%1, !!!ABENDING!!!"
     echo %1 - Error during Compile, refer to %BaseLib1%\LIST\%1.LST>%BaseLib1%\LOGS\%1.ERR
     goto :End
rem  *
rem  * ************************************************************************
pause
:End

Table of Contents Previous Section Next Section The Process Control File

The Process Control File contains the specifications that will be used to generate the COBOL source code that will be used to do a data file conversion. The following describes the record layout for the Process Control File.

Position Description
1 This is the record Identifier.
* - an asterisk in position one indicates the record is a comment.
& - an ampersand in position one indicates the record is a control statement.
2-11 This is a keyword. Position 11 is usually a space character.
12-256 This is a text string of parameters associated with the keyword.
  The Process Control File, Record Layout

The following describes the Keywords and Parameters for the statements in the Process Control File.

RecID & Keyword Parameters: the following group of statements will define the high level functions and processes to be performed
&SIMOPREP call ..\Env1BASE ... this text string will be inserted into the generated CMD File. If it is missing the user must explicitly specify the environment variables.
&USERPREP call UserCONV ... this text string will be inserted into the generated CMD File. If it is missing the user must explicitly specify the environment variables.
&CONFORM xxx where XXX is one of the following
IBM COBOL/2 compliant, the "IBM" keyword will cause the record structure (position and length of fields) to be calculated based on the size of COMP or BINARY fields used on the mainframe (i.e. binary fields are 2, 4 or 8 bytes only).
MF Micro Focus COBOL compliant, the "MF" keyword will cause the record structure (position and length of fields) to be calculated based on the size of COMP or BINARY fields used on the Wintel or UNIX platforms (i.e. binary fields are based on the number of digit in the picture clause and may be 1, 2, 3, 4 , 5, 6, 7 or 8 bytes).
&COPYFILE xxxxxxxx.ext where XXXXXXXX is an eight character copy file name and the ext is the file extension. This is usually CPY for a copy file.
&HTMLFILE xxxxxxxx.ext where XXXXXXXX is an eight character HTML file name and the ext is the file extension. This is usually HTM for an HTML file. It is important to note that if the WEB Server for the HTML documents is a UNIX Server the name will be case-sensitive.
&USRXFILE xxxxxxxx where XXXXXXXX is an eight character name of a COBOL Copy File that will override the default copy file that is used to do the conversion for text strings (PIC X) within a record.
RecID & Keyword Parameters: the following group of statements will define the behavioral characteristics and environment variable for the file I/O Program to be generated. The generated program may do the file copy and/or record content conversion or it may call a second program to do the record content conversion.
&PROGID xxxxxxxx where XXXXXXXX is an eight character program name
&HEAD34 A short (34 characters) description of the program that is used at execution time to identify the program output.
&OVERRIDE ZOSUT1 - defines the SYSUT1 file as a ZOS formatted record sequential file.
&SYSUT1 NAME=xxxxxxxx ORG=xxxxxxxxxx RECFM=xxxxxxxx rlen=nnnnn KLEN=nnnn KPOS=nnnn
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT1. The default value is SYSUT1.
For example, name=TEMPGET would redefine the DDNAME for SYSUT1.
Note: if an OVERRIDE value of ZOSUT1 was specified then name=BSIODSN1 should be used.
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Data Set (KSDS).
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and Line Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
org=ZOSVREC defines a ZOS formatted sequential file with variable length records.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting postion of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
recmode   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
recvary   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values. This will add the DEPENDING ON to the FD statement using the eight-byte filename-LRECL field name.
&SYSUT1A
SYSUTnA   SYSUTnA - where n is 1 or 2 and Keyword format is alen=n apos=n with duplicates
alen   This keyword=parameter defines the length of an alternate key.
alen=nnnnn where nnnnn is the key length.
apos   This keyword=parameter defines the starting postion of an alternate key within the record.
apos=nnnnn where nnnnn is the key starting position within a record.
with   This is an optional keyword.
dupes   This keyword (dupes or duplicates) is used to specify a file that has duplicate keys for an alternate key (or index).
&SYSUT2 NAME=xxxxxxxx ORG=xxxxxxxxxx RECFM=xxxxxxxx rlen=nnnnn KLEN=nnnn KPOS=nnnn
name   This keyword=parameter defines the 8-character (or less) DD name for SYSUT2. The default value is SYSUT2.
name=TEMPOUT defines the DDNAME for SYSUT2.
org   This keyword=parameter defines the file organization.
org=SEQUENTIAL defines a sequential file.
org=INDEXED defines a a keyed-index file or VSAM Data Set (KSDS).
org=ASCII/CRLF defines an ASCII/Text file with Carriage Return and LIne Feed used as record separators.
org=ASCII/TEXT is the same as ASCII/CRLF.
recfm   This keyword=parameter defines the format of the records within the file.
recfm=FIXED defines the records as fixed length.
recfm=VARIABLE defines the records as variable length
rlen   This keyword=parameter defines the fixed record length of each record in the file.
rlen=nnnnn where nnnnn is the fixed record length. For variable length records refer to RMIN and RMAX.
rmin   This keyword=parameter defines the minimum record length of records in the file.
rmin=nnnnn where nnnnn is the minimum record length. For fixed record length files refer to RLEN.
rmax   This keyword=parameter defines the maximum record length of records in the file.
rmax=nnnnn where nnnnn is the maximum record length. For fixed record length files refer to RLEN.
block   This keyword=parameter defines the block length.
block=nnnnn where nnnnn is the block length
klen   This keyword=parameter defines the length of the key.
klen=nnnnn where nnnnn is the key length.
kpos   This keyword=parameter defines the starting postion of the key within the record.
kpos=nnnnn where nnnnn is the key starting position within a record.
recmode   This keyword will cause the RECORDING MODE to be added to the FD statement using the RECFM value.
recvary   This keyword will cause the RECORD VARYING to be added to the FD statement using the RMIN and RMAX values. This will add the DEPENDING ON to the FD statement using the eight-byte filename-LRECL field name.
&SYSUT2A
SYSUTnA   SYSUTnA - where n is 1 or 2 and Keyword format is alen=n apos=n with duplicates
alen   This keyword=parameter defines the length of an alternate key.
alen=nnnnn where nnnnn is the key length.
apos   This keyword=parameter defines the starting postion of an alternate key within the record.
apos=nnnnn where nnnnn is the key starting position within a record.
with   This is an optional keyword.
dupes   This keyword (dupes or duplicates) is used to specify a file that has duplicate keys for an alternate key (or index).
&TRANSMODE
XXX   TRANSMODE=XXX - where XXX is one of the following
Note:   if using the /TRANSCALL function to do the conversion then refer to the SimoREC1 documentation for specifying the conversion.
E2A   Do EDCDIC to ASCII conversion
A2E   Do ASCII to EBCDIC conversion
E2E   The input file (SYSUT1) and the output file (SYSUT2) are both EBCDIC. The /TransLATE option will perform the same as the /TransCOPY option.
A2A   The input file (SYSUT1) and the output file (SYSUT2) are both ASCII. The /TransLATE option will perform the same as the /TransCOPY option.
&TRANSINIT
XXXXXXXXXX   TRANSINIT=XXXXXXXXXX - where XXXXXXXXXX is one of the following
SPACES   Initialize the SYSUT2 record to all spaces
LOW-VALUES   Initialize the SYSUT2 record to all low-values
HIGH-VALUES   Initialize the SYSUT2 record to all high-values
X'00'   Initialize the SYSUT2 record to the hexadecimal value specified
  The Process Control File specifications for the Environment and File Format Conversion,

The following describes the Keywords and Parameters for Record Content Copy and Convert by Position and Length

RecID & Keyword Parameters: the following statements are the base functionality file the copy/convert specifications.
&TRANSCALL Callable routine name (eight characters maximum length)
If the callable routine name is *INC then a second parameter will be used to specify the name of the INCLUDE member that will be inserted into the generated COBOL source code. This function is typically used when converting a file with multiple record types and user-logic is used to determine the record type and make a call to the appropriate conversion routine. The following is an example of a statement that uses the *INC Function.
&TRANSCALL  *INC  MYINC.inc
&TRANSCOPY The TRANSCOPY function will simply copy information from the input record to the output record. The keyword/parameter syntax is as follows:
FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
&TRANSFILL The TRANSFILL function insert the immediate data into the specified text string. The keyword/parameter syntax is as follows:
POS pos-1 LEN len-1 'zzzzzzzz'
or
POS pos-1 LEN len-1 x'zzzzzzzz'
&TRANSFLIP The TRANSFLIP function switch the order of the bytes within the specified text string. The keyword/parameter syntax is as follows:
FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
&TRANSLATE The TRANSLATE function will the specified text string from the input record to the output record and then convert the output text string based on the TRANSMODE specification. The keyword/parameter syntax is as follows:
FROM POS pos-1 LEN len-1 TO POS pos-2 LEN len-2
&TRANSVREC The TRANSVREC function requires one parameter. If used it must be ENABLE or DISABLE. If the ENABLE is specified the input record will be copied to the output record based on the length if the input record. If this function is missing the DISABLE keyword is used then the Variable length information will be ignored.
  The Process Control File specifications for the Record Content Copy and Convert by Position and Length

The following describes the Keywords and Parameters for Record Content Convert from Fixed-Field to CSV.

RecID and Keyword Parameters: the following two statements are used when the records in the data file (input or output) are a Comma-Separated-Values (or CSV) format.
&DELIMITER This is the character (one byte) that is used as the field delimiter. It will be inserted between each field. The default value is a comma character.
&FRAME This is the character (one byte) that is used to frame a field if the field contains a delimiter character. In other words if a text string or field contains a delimiter character a frame character will be insert before and after the text string or field. The default value is a double quote mark.
RecID & Keyword Parameters: the following group of statements will define the behavioral characteristics and environment variables for the record content conversion program to be generated. This is for CSV Formatted output records.
&EXTCALL The name of the callable program that will do the actual record content conversion.
&EXTREC The logical name of the record. Use (or Cut-and-Paste) the logical record name defined in the COBOL Copy File.
&EXTLRECL Should be the maximum record length for the CSV File
&EXTFMT Should be CSV
&EXTINIT Identify the character to be used to initialize the output record buffer.
&EXTHDR Requires a YES or NO value, will put header information as the first record in the file
&EXTRACT The logical field name as define in the COBOL Copy File. An EXTRACT statement must be included for each field to be included in the output record.
RecID & Keyword Parameters: Identify the end of the Process Control Statements.
&END End of control statements, this statement is optional.
  The Process Control File specifications for the Record Content Conversion from Fixed-Field to CSV

 

Table of Contents Previous Section Next Section Ancillary Functions

This section provides additional detail about the secondary CMD files and programs that are used in this set of sample programs.

Table of Contents Previous Section Next Section Set the Environment

A command file (ENV1BASE.cmd) is called from other command files to set commonly used environment variables. This provides a single point of definition. The following is a listing of the contents of the command file.

rem  * *******************************************************************
rem  *               ENV1BASE.cmd - a Windows Command File               *
rem  *        This program is provided by SimoTime Technologies          *
rem  *           (C) Copyright 1987-2016 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 commonly used 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 BASETEK1=C:\DEVOTEK1
     set BASELIB8=C:\SIMOSAM8
     set BASEWEB1=C:\SIMOWEB1
     set BaseLIBR=%BASETEK1%\UTIL
     set BaseLib1=%BaseLIBR%\DEVL
     set SIMOCORE=%BASETEK1%\CORE
     set BASEAPP=%BaseLib1%
     set BASESYS=%BaseLib1%\SYS1
     set BasePRD1=%BaseLIBR%\PROD
     set SYSLOG=%BaseLib1%\LOGS\SYSLOG_USER.TXT
     set SYSOUT=%BaseLib1%\LOGS\SYSOUT_USER.TXT
     set SimoNOTE=%BaseLib1%\LOGS\SimoNOTE_USER.TXT
     set SimoLIBR=c:\SimoLIBR
     set MIFOEDEV="C:\Program Files (x86)\Micro Focus\Enterprise Developer\bin"
     set MIFOBASE="C:\Program Files (x86)\Micro Focus\Studio Enterprise Edition 6.0\Base"
     set MIFOBIN=%MIFOBASE%\bin
     call SimoNOTE "* Starting JobName ENV1BASE.cmd"
rem  *
     set COBPATH=.;c:\SimoLIBR
     set COBIDY=%BASELIB1%\COBIDY
rem  *
     if "%MIFOSYS1%" == "ESTU" set CobCpy=%BASEAPP%\CobCpy1;%SIMOCORE%\CBLCOPY;%MIFOBASE%\SOURCE
     if "%MIFOSYS1%" == "EDEV" set CobCpy=%BASEAPP%\CobCpy1;%SIMOCORE%\CBLCOPY;%MIFOEDEV%\CPYLIB
rem  *
     if "%SIMOPATH%" == "Y" goto JUMPPATH
     if "%MIFOSYS1%" == "ESTU" set path=%BASESYS%\LOADLIB;%MIFOBASE%;%MIFOBIN%;%PATH%;
     if "%MIFOSYS1%" == "EDEV" set path=%BASESYS%\LOADLIB;%MIFOEDEV%;%PATH%;
:JUMPPATH
     set SIMOPATH=Y
     set JobStatus=0000
     call SimoNOTE "* Settings CmdName ENV1BASE.cmd, Version 14.03.28, %MIFOSYS1%"
     call SimoNOTE "* MIFOSYS1 .... %MIFOSYS1%"
     call SimoNOTE "* BaseAPP ..... %BASEAPP%"
     call SimoNOTE "* Conclude MIFOSYS1 is %MIFOSYS1% JobName ENV1BASE.cmd"
     call SimoNOTE "* Finished JobName ENV1BASE.cmd"

Table of Contents Previous Section Next Section Display and Log Messages

The following is a listing of the contents of the SimoNOTE.cmd command file.

@echo OFF
rem  * *******************************************************************
rem  *               SIMONOTE.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    - 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 Possibilities and Considerations

This section provides additional detail about the process for generating, compiling and executing a data file conversion program. This discussion will focus on the Windows environment. However, the process is very similar for the mainframe and UNIX environments once the COBOL source code has been generated on a Windows system running with a Micro Focus technology for the development environment.

Table of Contents Previous Section Next Section Impact of Record Content Conversion

A first step is to determine the encoding schema (i.e. ASCII or EBCDIC) for the target environment. The following may be helpful in making this decision.

Item Description
1 If the application being migrated (or replicated) to a non-mainframe platform will continue to complement or coexist with applications or data that will continue to reside on the mainframe then configuring the new environment to use an EBCDIC-encoding schema is a viable and practical approach.
2 If the application being migrated (or moved) to a non-mainframe platform (with little or no dependencies on the mainframe) then configuring the new environment to use an ASCII-encoding schema is a viable and practical approach.
3 Interface Requirements may influence or dictate the encoding schema.
Application Interfaces - Applications may use or interface with third-party software packages. When the mainframe third-party packages are replaced with a distributed version it may require an ASCII interface. This would require an EBCDIC to ASCII conversion on demand to address the specific requirement or a complete conversion of the application and data to an ASCII encoded environment.
Data Exchange Interfaces - Delivering Reports or Data Files to other business users.
4 If the new environment is ASCII then interfaces with the IBM Mainframe and AS/400 may require a conversion back to EBCDIC. Mid-Range Servers and Personal Computers should not require data conversion.
5 If the new environment is EBCDIC then data content shared with the IBM Mainframe and AS/400 should be in the proper format. Mid-Range Servers and Personal Computers will probably require an EBCDIC to ASCII Conversion.
  Considerations for Staying with EBCDIC or Converting to ASCII

When approaching a file content conversion (i.e. EBCDIC-encoding to ASCII-encoding) it is a good practice to use an existing data definition of the record layout if one exists. Creating a new or propriety set of data definition specifications increases the risk of introducing new errors in the conversion process.

A COBOL copy file that defines the record layouts within a file is usually available or a COBOL program with a working storage definition may be "cut-and-pasted" into a new COBOL copy file that is then used to create a data conversion process at the field level.

Note: It is important to emphasize the need for good documentation and definitions of the record layouts for every file that will be converted.

It can be a challenge to convert EBCDIC-encoded data with fixed length fields interspersed with numeric fields of binary and/or packed values into a format that is suitable for an ASCII-encoded Excel spreadsheet. This will require the expansion of the numeric fields.

The data conversion process should be a repeatable process with an audit or validation trail. The process should be executable as an automated, unattended process. Requiring operator input during the data file conversion process introduces an exposure point for error.

Table of Contents Previous Section Next Section Confusion Factors, How & What To Do

The record content conversion between encoding schemes such as EBCDIC and ASCII only applies to alpha-numeric (or text oriented) data strings (or fields) within a record structure. Numeric fields that use a "COMPUTATIONAL" format are neither EBCDIC or ASCII. Therefore, they are excluded from the EBCDIC to ASCII conversion process. Computation numeric fields (i.e. COMP and COMP-1 through 5) use their own formatting rules.

There is a numeric type (unsigned zoned decimal) that is in a display format and follows the EBCDIC or ASCII rules. A COMP field may be easily converted (or expanded) to a display value using the techniques described in the following document.

This suite of example programs describes  how to convert between the various numeric formats  used with COBOL and on an IBM Mainframe System.

To save storage space some record structures will use each bit of a one-byte field as a unique identifier. This technique provides application programmers with eight unique indicators that may be used to determine program behavior when processing the record. If this technique is used the one-byte field must be bypassed as part of an EBCDIC/ASCII conversion.

Table of Contents Previous Section Next Section Factor Zero, Minimum Confusion

Lets start with a simple conversion with a minimum amount of confusion or Zero confusion factors. The following COBOL program (CV80ERAR.cbl) will do a simple conversion of an EBCDIC-encoded record sequential file into an ASCII-encoded record sequential file.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CV80ERAR.
       AUTHOR.        SIMOTIME TECHNOLOGIES.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:52:80    *
      *                                                               *
      *                                   Record    Record     Key    *
      *  Function  Name     Organization  Format    Max-Min  Pos-Len  *
      *  PRIMARY   GETRS080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *  SECONDARY PUTRS080 SEQUENTIAL    FIXED      00080            *
      *                                                               *
      *                                                               *
      *            Translation Mode is EBCDIC to ASCII                *
      *                                                               *
      *****************************************************************
       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       FILE-CONTROL.
           SELECT GETRS080-FILE  ASSIGN TO       GETRS080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS GETRS080-STATUS.
           SELECT PUTRS080-FILE  ASSIGN TO       PUTRS080
                  ORGANIZATION  IS SEQUENTIAL
                  ACCESS MODE   IS SEQUENTIAL
                  FILE STATUS   IS PUTRS080-STATUS.

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

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

      *****************************************************************
      * This program was created with the SYSMASK1.TXT file as input. *
      * The SYSMASK1 provides for the sequential reading of the input *
      * file and the sequential writing of the output file.           *
      *                                                               *
      * If the output file is indexed then the input file must be in  *
      * sequence by the field that will be used to provide the key    *
      * for the output file. This is a sequential load process.       *
      *                                                               *
      * If the key field is not in sequence then refer to SYSMASK2    *
      * to provide for a random add or update of the indexed file.    *
      *                                                               *
      * This program mask will have the ASCII/EBCDIC table inserted   *
      * for use by the /TRANSLATE function of SimoZAPS.               *
      *                                                               *
      * For more information or questions please contact SimoTime     *
      * Technologies. The version control number is 20.00.00          *
      *                                                               *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
       WORKING-STORAGE SECTION.
       01  SIM-TITLE.
           05  T1 pic X(11) value '* CV80ERAR '.
           05  T2 pic X(34) value 'Convert 80/80 EBC_RSEQ to ASC_RSEQ'.
           05  T3 pic X(10) value ' v20.00.00'.
           05  T4 pic X(24) value '   helpdesk@simotime.com'.
       01  SIM-COPYRIGHT.
           05  C1 pic X(11) value '* CV80ERAR '.
           05  C2 pic X(32) value 'This Data File Convert Member wa'.
           05  C3 pic X(32) value 's generated by SimoTime Technolo'.
           05  C4 pic X(04) value 'gies'.

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

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

       01  GETRS080-LRECL            pic 9(5)    value 00080.
       01  PUTRS080-LRECL            pic 9(5)    value 00080.
       01  GETRS080-LRECL-MAX        pic 9(5)    value 00080.
       01  PUTRS080-LRECL-MAX        pic 9(5)    value 00080.

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

      *****************************************************************
      * Message Buffer used by the Z-DISPLAY-MESSAGE-TO-SYSOUT routine.    *
      *****************************************************************
       01  MESSAGE-BUFFER.
           05  MESSAGE-HEADER      pic X(011)  value '* CV80ERAR '.
           05  MESSAGE-TEXT.
               10  MESSAGE-TEXT-1  pic X(068)  value SPACES.
               10  MESSAGE-TEXT-2  pic X(188)  value SPACES.
       01  MSG-LSB                 pic 9(5)    value 267.

      *****************************************************************
       01  PROGRAM-NAME            pic X(8)     value 'CV80ERAR'.

       01  INFO-STATEMENT.
           05  INFO-SHORT.
               10  INFO-ID pic X(8)    value 'Starting'.
               10  filler  pic X(2)    value ', '.
               10  filler  pic X(34)
                   value   'Convert 80/80 EBC_RSEQ to ASC_RSEQ'.
           05  filler      pic X(24)
               value ' http://www.SimoTime.com'.

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

       01  WRITE-FLAG      pic X       value 'Y'.

       01  GETRS080-TOTAL.
           05  GETRS080-RDR  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for GETRS080'.
       01  PUTRS080-TOTAL.
           05  PUTRS080-ADD  pic 9(9)    value 0.
           05  filler      pic X(3)    value ' - '.
           05  filler      pic X(23)   value 'Line count for PUTRS080'.

      *****************************************************************
      * The following copy file contains the translation tables for   *
      * the ASCII and EBCDIC conversion. Also, sections of the tables *
      * may be used for case conversion.                              *
      *****************************************************************
       COPY ASCEBCB1.
      *****************************************************************
       PROCEDURE DIVISION.
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move INFO-STATEMENT to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           move all '*' to MESSAGE-TEXT-1
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           perform Z-POST-COPYRIGHT
           perform GETRS080-OPEN
           perform PUTRS080-OPEN

      *    USRSOJ Processing not specified...

           perform until GETRS080-STATUS not = '00'
               perform GETRS080-READ
               if  GETRS080-STATUS = '00'
                   add 1 to GETRS080-RDR
                   move 'Y' to WRITE-FLAG
                   perform BUILD-OUTPUT-RECORD
                   if  WRITE-FLAG = 'Y'
                       perform PUTRS080-WRITE
                       if  PUTRS080-STATUS = '00'
                           add 1 to PUTRS080-ADD
                       end-if
                   end-if
               end-if
           end-perform

      *    USREOJ Processing not specified...

           move GETRS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           move PUTRS080-TOTAL to MESSAGE-TEXT
           perform Z-DISPLAY-MESSAGE-TO-USERS

           if  APPL-EOF
               move 'Complete' to INFO-ID
           else
               move 'ABENDING' to INFO-ID
           end-if
           move INFO-STATEMENT to MESSAGE-TEXT(1:79)
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT

           perform PUTRS080-CLOSE
           perform GETRS080-CLOSE
           GOBACK.

      *****************************************************************
       BUILD-OUTPUT-RECORD.
      *    TransMODE is E2A...
      *    TransINIT process...
           move ALL X'20'       to PUTRS080-REC
      *    TransLATE...
           move GETRS080-REC(00001:00080) to PUTRS080-REC(00001:00080)
           inspect PUTRS080-REC(1:80)      converting E-INFO to A-INFO
           exit.

      *****************************************************************
      * I/O Routines for the INPUT File...                            *
      *****************************************************************
       GETRS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with GETRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       GETRS080-READ.
           read GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  GETRS080-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if
           if  APPL-AOK
               CONTINUE
           else
               if  APPL-EOF
                   move 'Y' to GETRS080-EOF
               else
                   move 'READ Failure with GETRS080' to MESSAGE-TEXT
                   perform Z-DISPLAY-MESSAGE-TO-USERS
                   move GETRS080-STATUS to IO-STATUS
                   perform Z-DISPLAY-IO-STATUS
                   perform Z-ABEND-PROGRAM
               end-if
           end-if
           exit.
      *---------------------------------------------------------------*
       GETRS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open input GETRS080-FILE
           if  GETRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to GETRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with GETRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move GETRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

      *****************************************************************
      * I/O Routines for the OUTPUT File...                           *
      *****************************************************************
       PUTRS080-WRITE.
           if  PUTRS080-OPEN-FLAG = 'C'
               perform PUTRS080-OPEN
           end-if
           write PUTRS080-REC
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
           else
               if  PUTRS080-STATUS = '10'
                   add 16 to ZERO giving APPL-RESULT
               else
                   add 12 to ZERO giving APPL-RESULT
               end-if
           end-if.
           if  APPL-AOK
               CONTINUE
           else
               move 'WRITE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-OPEN.
           add 8 to ZERO giving APPL-RESULT.
           open OUTPUT PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'O' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'OPEN Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.
      *---------------------------------------------------------------*
       PUTRS080-CLOSE.
           add 8 to ZERO giving APPL-RESULT.
           close PUTRS080-FILE
           if  PUTRS080-STATUS = '00'
               subtract APPL-RESULT from APPL-RESULT
               move 'C' to PUTRS080-OPEN-FLAG
           else
               add 12 to ZERO giving APPL-RESULT
           end-if
           if  APPL-AOK
               CONTINUE
           else
               move 'CLOSE Failure with PUTRS080' to MESSAGE-TEXT
               perform Z-DISPLAY-MESSAGE-TO-USERS
               move PUTRS080-STATUS to IO-STATUS
               perform Z-DISPLAY-IO-STATUS
               perform Z-ABEND-PROGRAM
           end-if
           exit.

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

      *****************************************************************
       Z-CALCULATE-MESSAGE-LSB.
           add 267 to ZERO giving MSG-LSB
           perform until MSG-LSB < 80
                      or MESSAGE-BUFFER(MSG-LSB:1) not = SPACE
             if MESSAGE-BUFFER(MSG-LSB:1) = SPACE
                subtract 1 from MSG-LSB
             end-if
           end-perform
           exit.

      *****************************************************************
      * Post message to the SYSOUT device, clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-SYSOUT.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB)
           move all SPACES to MESSAGE-TEXT
           exit.
      *****************************************************************
      * Display message to console, do not clear message buffer...    *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-CONSOLE.
           perform Z-CALCULATE-MESSAGE-LSB
           display MESSAGE-BUFFER(1:MSG-LSB) upon console
           exit.
      *****************************************************************
      * Display message to console and post to SYSOUT device...       *
      *****************************************************************
       Z-DISPLAY-MESSAGE-TO-USERS.
           perform Z-DISPLAY-MESSAGE-TO-CONSOLE
           perform Z-DISPLAY-MESSAGE-TO-SYSOUT
           exit.

      *****************************************************************
      * Display the file status bytes. This routine will display as   *
      * four digits. If the full two byte file status is numeric it   *
      * will display as 00nn. If the 1st byte is a numeric nine (9)   *
      * the second byte will be treated as a binary number and will   *
      * display as 9nnn.                                              *
      *****************************************************************
       Z-DISPLAY-IO-STATUS.
           if  IO-STATUS not NUMERIC
           or  IO-STAT1 = '9'
               move IO-STAT1 to IO-STATUS-04(1:1)
               subtract TWO-BYTES-BINARY from TWO-BYTES-BINARY
               move IO-STAT2 to TWO-BYTES-RIGHT
               add TWO-BYTES-BINARY to ZERO giving IO-STATUS-0403
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TO-USERS
           else
               move '0000' to IO-STATUS-04
               move IO-STATUS to IO-STATUS-04(3:2)
               move 'File Status is: nnnn' to MESSAGE-TEXT
               move IO-STATUS-04 to MESSAGE-TEXT(17:4)
               perform Z-DISPLAY-MESSAGE-TO-USERS
           end-if
           exit.

      *****************************************************************
       Z-POST-COPYRIGHT.
           display SIM-TITLE
           display SIM-COPYRIGHT
           exit.
      *****************************************************************
      *           This program was generated by SimoZAPS              *
      *             A product of SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *                                                               *
      *  Generation Date: 2020-03-20  Generation Time: 16:54:52:80    *
      *****************************************************************

Table of Contents Previous Section Next Section 1. Records Contain Packed or Binary Fields

Now lets add the first confusion factor. We will include a packed-decimal (or COMP-3) field in the record structure.

Table of Contents Previous Section Next Section 2. Spaces Allowed in Packed Fields

Now lets take a look at a special case where Packed fields were initialized with spaces. This should never be done and is an accident waiting to happen.

Allowing spaces in a packed, numeric field <>should never be allowed. However, it has happened and continues to happen on an infrequent basis. The cause for this condition should be identified and corrected. A typical cause for this condition is the initialization of a record area to spaces with the record area (or record buffer) being treated as a single text string.

For numeric fields with USAGE IS COMP-3 (i.e. PACKED FIELDS) the conversion code generated by SimoTime does not do any conversion. This is the default behavior.

Since we have encountered a few instances where a packed field may contain SPACES we have addressed this situation with a configuration option. The conversion utility has the ability to convert a record on a field-by-field basis and provides two alternatives for correcting this issue during the migration step. Refer to the "Process Control File Section" of this document.

A SPACE character (hex 40 for EBCDIC or a hex 20 for ASCII) could be a valid entry in a packed field in all the positions of the field except the units position. It would be reasonable to assume that if the units position of a packed field is a SPACE character and all other positions are SPACE characters then the packed field SPACE values should be converted. The following is sample code that will test a packed field for SPACE values and then convert the EBCDIC SPACE values to ASCII SPACE values.

      *    Packed  CUST-CREDIT-LIMIT
      *    The &PACKEDFLD option is set to SPACECONVERT
           if CUST-RECORD(300:4) = all x'40'
              inspect CUST-RECORD(300:4)   replacing all x'40' by x'20'
           end-if

The following is sample code that will test a packed field for SPACE values and then initialize the packed field to ZERO values.

      *    Packed  CUST-CREDIT-LIMIT
      *    The &PACKEDFLD option is set to SPACEZERO
           if CUST-RECORD(300:4) = all x'40'
              inspect CUST-RECORD(300:4)   replacing all x'40' by x'00'
              move x'0F' to CUST-RECORD(303:1)
           end-if

Attention: It is important to emphasize the risk of allowing spaces in a packed, numeric field (or any numeric field). The SimoTime conversion programs provide for converting the spaces or setting the field to a value of zeroes. This will correct the file on a one-time basis. The original process or program that is placing spaces into the numeric field should be identified and corrected.

Table of Contents Previous Section Next Section 3. Convert File Format & Record Content

Do a file format conversion and record content conversion in a single pass of the input file.

The following is the Process Control File (CUREKA01.pcf) that will define the process and parameters required to convert an EBCDIC-encoded, record sequential file (RSEQ) to an ASCII-encoded, key sequenced data set (KSDS).

***********************************************************************
*                CUREKA01.pcf - a Process Control File                *
*               SimoTime Program Generation Technologies              *
*            (C) Copyright 1987-2019 All Rights Reserved              *
*               Web Site URL:   http://www.simotime.com               *
*                     e-mail:   helpdesk@simotime.com                 *
***********************************************************************
* SYSUT1 is a Record Sequential,  512-byte, fixed, EBCDIC file for
*        the Customer Master file. This file was downloaded from the
*        mainframe using BINARY mode.
* SYSUT2 is a KSDS, 512-byte, variable, ASCII file for the Customer
*        Master file used in a non-mainframe environment.
*
* This procdedure will generate the IO Program, the callable convert
* routine and the HTML Documentation for the Customer Master file.
* The primary purpose for this program is to do the initial load of
* the Customer Master file. The records in the input file (SYSUT1)
* must be in ascending sequence by the field that is used as the key
* in the Customer Master File.
***********************************************************************
* For more information about a Process Control File (PCF) that will
* generate data conversion programs refer to the following.
*
*
* Refer to http://www.simotime.com/utconv01.htm for additional detail
* about the PCF statements for Data Convert.
*
* This set of specification will generate an mainline I/O program and a
* callable COBOL routine that will convert an EBCDIC-encoded file to an
* ASCII-encoded file.
***********************************************************************
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCONV
&CONFORM   IBM
*
* The following COPYFILE statement defines the COBOL copy file that
* will be used to convert the record structure at the field level.
* Also, the copy file will be used to create the documentation for
* the record structure.
*
&COPYFILE  CUSTCB01.cpy
*
* The following HTMLFILE statement causes the HTML document for the
* record structure to be generated. The parameter defines the name
* of the document.
*
&HTMLFILE  custcb01.htm
*
* Defines an eight character name of a COBOL Copy File that will
* override the default copy file that is used to do the conversion
* for text strings (PIC X) within a record.
*
&USRXFILE  AE0437B1
*
* The following group of statements are for the file I/O program and
* will define the file properties and behavioral characteristics for
* the Program to be generated.
*
&VSAMload  SEQUENTIAL
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    Read EBCDIC/RSEQ, Load ASCII/KSDS
&IOMODNAME CUREKAC1
&SYSUT1    name=CUSRE512 org=Sequential recfm=FIXED    rlen=512
&SYSUT2    name=CUSKS512 org=Indexed    recfm=VARIABLE rmin=512 rmax=512 kpos=1 klen=12
*
* The following group of statements are for the callable conversion
* program and will define the behavioral characteristics for the
* program to be generated.
*
&PACKEDFLD SPACECONVERT
&TransCALL CUREKAR1
&TransMODE E2A
*
&END

Table of Contents Previous Section Next Section 4. Convert KSDS-FFL to ASCII-Text-CSV

The following links will describe and demonstrate how to do a data extract from a VSAM, KSDS with Fixed Field Length (FFL) Format to ASCII/Text with Comma-Separated-Values format that includes expanding packed and binary fields to a text format.

Link to Internet   Link to Server   Explore How to Convert a Fixed-Field-Length Record Structure to a Comma-Separated-Values Record Structure.  This technique is used to extract data from a VSAM, Key-Sequenced-Data-Set (KSDS) with a record structure that uses fixed-length fields. The new CSV format may be easily loaded into an Excel spread sheet.

Table of Contents Previous Section Next Section 5. Code Page & High-Values or x'FF'

When using the International Character Set, "Why do the HIGH-VALUES or x'FF' get converted to x'9F'?"

The "Y" character with an umlaut (both upper and lower case characters of ? and ˜) may affect program logic that is dependent on a High-Values or HEX "FF" content. The following table is used when it is a requirement to maintain the High-Values (or hex "FF") content. It will not translate the "Y" character with an umlaut.

Refer to the "Alternate Codes, Grave, Acute, Circumflex, Umlaut and Tilde" in the following document.

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.

Table of Contents Previous Section Next Section 6. Sequence of EBCDIC & ASCII

The following describes the differences in the EBCDIC and ASCII Sorting (or collating) sequences with examples that may lead to program logic failures.

Link to Internet   Link to Server   Explore a suite of sample programs that describes the ASCII and EBCDIC sorting or collating sequences and provides an example of programming logic that will work in an EBCDIC environment (i.e. Mainframe System with ZOS) but fail in an ASCII environment (i.e. Linux, UNIX or Windows with Micro Focus).

Table of Contents Previous Section Next Section Technical Details

This section describes additional details about the technology available and/or the possible approaches used to handle the unexpected situations that may occur during a character set conversion.

Table of Contents Previous Section Next Section Convert Tables, without Umlaut-Y

The "Y" character with an umlaut (both upper and lower case characters of ? and ˜) may affect program logic that is dependent on a High-Values or HEX "FF" content. The following table is used when it is a requirement to maintain the High-Values (or hex "FF") content. It will not translate the "Y" character with an umlaut.

      *****************************************************************
      *               AE9437B1.cpy - a COBOL Copy File                *
      *         Copyright (C) 1987-2018 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * The following tables are used by the INSPECT statement to do  *
      * the conversion between EBCDIC and ASCII.                      *
      *                                                               *
      *   inspect FIELD-NAME converting EBCDIC-INFO to ASCII-INFO     *
      *   inspect FIELD-NAME converting ASCII-INFO  to EBCDIC-INFO    *
      *                                                               *
      * The tables include the alphabet for upper and lower case, the *
      * digits 0-9, the special characters (US) and the alternate     *
      * codes for A, E, I, O, and U with the appropriate acute,       *
      * grave, umlaut, circumflex and tilde.                          *
      * To display the alternate codes the Courier New (Fixed) or     *
      * Times New Roman (Proportional) font should be used.           *
      *                                                               *
      * SimoZAPS contains four tables that may be used for various    *
      * Upper/Lower Case or EBCDIC/ASCII conversion requirements.     *
      * ASCEBCB1.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table does not convert the Y     *
      *                characters with an umlat.                      *
      * ASCEBCB2.CPY - includes the character set for the translation *
      *                between EBCDIC/ASCII of signed/unsigned,       *
      *                zoned-decimal, numeric fields.                 *
      * ASCEBCB3.CPY - includes the character set for the alternate   *
      *                codes with the acute, grave, umlaut, tilde and *
      *                circumflex. This is primarily used for case    *
      *                conversion.                                    *
      *                Note: this table converts the Y characters     *
      *                with an umlat, this will convert high-values   *
      *                X'FF' to X'DF'                                 *
      * ASCEBCB4.CPY - includes the character set for the alphabet    *
      *                (upper/lower case), digit, special characters. *
      *                This is primarily used in the US where the     *
      *                alternate codes may not be required.           *
      * ASCEBCB5.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table will convert the Y         *
      *                characters with an umlat.                      *
      *****************************************************************
      *
      *    ------------------------------------------------------------
       01  EBCDIC-DATA.
           05  FILLER pic X(16)
                          value X'000102030405060708090A0B0C0D0E0F'.    000-015
           05  FILLER pic X(16)
                          value X'101112131415161718191A1B1C1D1E1F'.    016-031
           05  FILLER pic X(16)
                          value X'202122232425262728292A2B2C2D2E2F'.    032-047
           05  FILLER pic X(16)
                          value X'303132333435363738393A3B3C3D3E3F'.    048-063
           05  FILLER pic X(16)
                          value X'404142434445464748494A4B4C4D4E4F'.    064-079
           05  FILLER pic X(16)
                          value X'505152535455565758595A5B5C5D5E5F'.    080=095
           05  FILLER pic X(16)
                          value X'606162636465666768696A6B6C6D6E6F'.    096-111
           05  FILLER pic X(16)
                          value X'707172737475767778797A7B7C7D7E7F'.    112-127
           05  FILLER pic X(16)
                          value X'808182838485868788898A8B8C8D8E8F'.    128-143
           05  FILLER pic X(16)
                          value X'909192939495969798999A9B9C9D9E9F'.    144-159
           05  FILLER pic X(16)
                          value X'A0A1A2A3A4A5A6A7A8A9AAABACADAEAF'.    160-175
           05  FILLER pic X(16)
                          value X'B0B1B2B3B4B5B6B7B8B9BABBBCBDBEBF'.    176-191
           05  FILLER pic X(16)
                          value X'C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF'.    192-207
           05  FILLER pic X(16)
                          value X'D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF'.    208-223
           05  FILLER pic X(16)
                          value X'E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF'.    224-239
           05  FILLER pic X(16)
                          value X'F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF'.    240-255

       01  E-INFO           redefines EBCDIC-DATA pic X(256).
       01  EBCDIC-TABLE     redefines EBCDIC-DATA.
           05  EBCDIC-BYTE  pic X     occurs 256 times.
      *
      *    ------------------------------------------------------------
       01  ASCII-DATA.
           05  FILLER pic X(16)
                          value X'000102039C09867F978D8E0B0C0D0E0F'.    000-015
           05  FILLER pic X(16)
                          value X'101112139D8508871819928F1C1D1E1F'.    016-031
           05  FILLER pic X(16)
                          value X'80818283840A171B88898A8B8C050607'.    032-047
           05  FILLER pic X(16)
                          value X'909116939495960498999A9B14159E1A'.    048-063
           05  FILLER pic X(16)
                          value X'20A0E2E4E0E1E3E5E7F1A22E3C282B7C'.    064-079
           05  FILLER pic X(16)
                          value X'26E9EAEBE8EDEEEFECDF21242A293BAC'.    080=095
           05  FILLER pic X(16)
                          value X'2D2FC2C4C0C1C3C5C7D1A62C255F3E3F'.    096-111
           05  FILLER pic X(16)
                          value X'F8C9CACBC8CDCECFCC603A2340273D22'.    112-127
           05  FILLER pic X(16)
                          value X'D8616263646566676869ABBBF0FDFEB1'.    128-143
           05  FILLER pic X(16)
                          value X'B06A6B6C6D6E6F707172AABAE6B8C6A4'.    144-159
           05  FILLER pic X(16)
                          value X'B57E737475767778797AA1BFD0DDDEAE'.    160-175
           05  FILLER pic X(16)
                          value X'5EA3A5B7A9A7B6BCBDBE5B5DAFA8B4D7'.    176-191
           05  FILLER pic X(16)
                          value X'7B414243444546474849ADF4F6F2F3F5'.    192-207
           05  FILLER pic X(16)
                          value X'7D4A4B4C4D4E4F505152B9FBFCF9FAFF'.    208-223
           05  FILLER pic X(16)
                          value X'5CF7535455565758595AB2D4D6D2D3D5'.    224-239
           05  FILLER pic X(16)
                          value X'30313233343536373839B3DBDCD9DAFF'.    240-255
       01  A-INFO           redefines ASCII-DATA pic X(256).
       01  ASCII-TABLE      redefines ASCII-DATA.
           05  ASCII-BYTE   pic X     occurs 256 times.
      *
      ***  AE0437B1 - End-of-Copy File - - - - - - - - - - - AE0437B1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Convert Tables, Signed Zoned Decimal

The following table will convert zoned-numeric values based on the original IBM specifications for signed zoned numeric values. In COBOL this is usually defines as "USAGE IS DISPAY" or it is the default if the "USAGE" is missing.

      *****************************************************************
      *               ASCEBCB2.CPY - a COBOL Copy File                *
      *         Copyright (C) 1987-2018 SimoTime Technologies         *
      *                     All Rights Reserved                       *
      *              Provided by SimoTime Technologies                *
      *        Our e-mail address is: helpdesk@simotime.com           *
      *     Also, visit our Web Site at http://www.simotime.com       *
      *****************************************************************
      * The following tables are used by the INSPECT statement to do  *
      * the conversion between EBCDIC and ASCII for numeric, zoned    *
      * decimal fields.                                               *
      *   inspect FIELD-NAME converting E-NUMB to A-NUMB              *
      *   inspect FIELD-NAME converting A-NUMB to E-NUMB              *
      * This table includes a decimal point conversion and the space  *
      * character conversion. A space character is an invalid numeric *
      * entry and this situation does occur. A plus (+) or minus (-)  *
      * character will also be converted.                             *
      *                                                               *
      * SimoZAPS contains four tables that may be used for various    *
      * Upper/Lower Case or EBCDIC/ASCII conversion requirements.     *
      * ASCEBCB1.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table does not convert the Y     *
      *                characters with an umlat.                      *
      * ASCEBCB2.CPY - includes the character set for the translation *
      *                between EBCDIC/ASCII of signed/unsigned,       *
      *                zoned-decimal, numeric fields.                 *
      * ASCEBCB3.CPY - includes the character set for the alternate   *
      *                codes with the acute, grave, umlaut, tilde and *
      *                circumflex. This is primarily used for case    *
      *                conversion.                                    *
      *                Note: this table converts the Y characters     *
      *                with an umlat, this may convert high-values    *
      *                X'FF' to X'DF'
      * ASCEBCB4.CPY - includes the character set for the alphabet    *
      *                (upper/lower case), digit, special characters. *
      *                This is primarily used in the US where the     *
      *                alternate codes may not be required.           *
      * ASCEBCB5.CPY - includes a full character set for the alphabet *
      *                (upper/lower case), digit, special characters  *
      *                and alternate codes for characters with the    *
      *                acute, grave, umlaut, tilde and circumflex.    *
      *                Caution: this table will convert the Y         *
      *                characters with an umlat.                      *
      *****************************************************************
      *
       01  E-NUMB-DATA.
           05  filler  pic X(10) value X'F0F1F2F3F4F5F6F7F8F9'.
           05  filler  pic X(10) value X'C0C1C2C3C4C5C6C7C8C9'.
           05  filler  pic X(10) value X'D0D1D2D3D4D5D6D7D8D9'.
           05  filler  pic X(04) value X'4B404E60'.
      *                                   .   + -
       01  E-NUMB      redefines E-NUMB-DATA  pic X(34).
      *
       01  A-NUMB-DATA.
           05  filler  pic X(10) value X'30313233343536373839'.
           05  filler  pic X(10) value X'30313233343536373839'.
           05  filler  pic X(10) value X'70717273747576777879'.
           05  filler  pic X(04) value X'2E202B2D'.
      *                                   .   + -
       01  A-NUMB      redefines A-NUMB-DATA  pic X(34).
      *
      ***  ASCEBCB2 - End-of-Copy File - - - - - - - - - - - ASCEBCB2 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section Summary

SimoTime can do a file format conversion between a record sequential file and a Micro Focus Key-Sequenced-Data-Set or a record content conversion between EBCDIC and ASCII encoding schemas. An optional item is the creation of HTML Documentation for the record layouts based on a COBOL copy file. 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 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, Comment 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 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 Principles of Data File Conversion. This link includes guidelines for defining requirements and determining the scope of effort for a data conversion effort.

Link to Internet   Link to Server   Explore the Principles of Data File Validation. This link includes guidelines for defining requirements and determining the scope of effort for a data validation effort. This effort includes a data file compare process, a technique for accumulating summary totals with a record count and a technique for reading a VSAM, KSDS and producing a hex-dump output based on a list of user-defined keys.

Link to Internet   Link to Server   Explore How to Generate a Data File Compare, Validate or Hex-Dump Program using simple specification statements in a Process Control File (PCF). This link to the User Guide includes the information necessary to create a Process Control File and generate the COBOL programs that will do a data file compare, accumulate summary totals with a record count or produce a Hex-Dump of records in a VSAM, KSDS based on a list of user-defined keys. The User Guide contains a list of the PCF statements that are used for the data file compare, validate or dump process.

Link to Internet   Link to Server   Explore the COBOL Connection for more examples of COBOL programming techniques and sample code.

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.

A good place to start is The SimoTime Home Page for access to white papers, program examples and product information. This link requires an Internet Connection

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

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 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
Data File Convert, Generating Data File Conversion Programs
Copyright © 1987-2023
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com