Create Test Data
Sequential File with Zoned-Decimal
  Table of Contents  v-16.01.01 - zdtots08.htm 
  Introduction
  Create the Test Files
  Prepare
  Prepare Programs to Create Test Files
  The Process Control File
  Generate the Programs
  Compile the Programs
  Technical Details
  Record Structure for Test File
  COBOL Copy File for Test File
  HTML Document for Test File
  COBOL Compiler Directives
  Summary
  Software Agreement and Disclaimer
  Downloads and Links
  Current Server or Internet Access
  Internet Access Required
  Glossary of Terms
  Comments or Feedback
  Company Overview
The SimoTime Home Page 

Table of Contents Previous Section Next Section Introduction

This document will describe and demonstrate how to create test data for a sequential file with records that contain zoned-decimal (or USAGE IS DISPLAY) numeric fields.

The execution of this suite of programs is the 1st task within a group of three (3) tasks.

Link to Internet   Link to Server   Explore how to Create Test Data Files. For this suite of jobs and programs the file format will be record sequential and the record format will be a fixed-length of 80-byte records containing text strings and zoned-decimal numeric fields.

Link to Internet   Link to Server   Explore how to Calculate a Record Count and Accumulate Summary Totals by reading a Record Sequential Data File. Each record contains numeric fields with a Zoned-Decimal (USAGE IS DISPLAY) format. The count and totals will be posted to the SYSOUT device.

Link to Internet   Link to Server   Explore how to Validate the Content of Two Data Files by doing a record-by-record compare of two sequential files with 121-byte records. The COBOL source code for the program was generated using SimoTime technologies. This suite of programs was originally inteneded to compare two SYSOUT files since a SYSOUT device is typically configured as a record sequential file with 121-byte records.


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

Table of Contents Previous Section Next Section Create the Test Files

A Windows Command File will be used to create two test files. Each of the test files will be processed and two "Report-Oriented" files that contain Summary Totals and a Record Count will be created.

The "Report-Oriented" files are then programmatically compared to see if they are Equal or Not Equal in content.

The following Windows Command File (ZDTOTSW8.cmd) will set the environment and execute the programs that create the test files.

@echo OFF
rem  * *******************************************************************
rem  *               ZDTOTSW8.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 two Sequential Data Sets for testing.
rem  * Author - SimoTime Technologies
rem  * Date   = January 24, 1996
rem  *
rem  * The 1ST and 3RD steps will delete a previously created file and then
rem  * create a new ASCII/Text file.
rem  * The 2ND and 4TH steps will convert the Line Sequential file to a
rem  * Record Sequential file and keep the ASCII encoding.
rem  *
rem  * This set of programs will run on a Windows System with Micro Focus
rem  * Enterprise Developer.
rem  *
     set CmdName=ZDTOTSW8
     call ..\Env1BASE %CmdName%
     if "%SYSLOG%" == "" set syslog=c:\SimoLIBR\LOGS\SimoTime.LOG
rem  *
     call SimoNOTE "*******************************************************%CmdName%"
     call SimoNOTE "Starting CmdName %CmdName%, User is %USERNAME%"
rem  *
rem  * *******************************************************************
rem  * Step 1 of 4, Create and populate the 1st ASCII/TEXT file.
rem  *              Use instream data of a Comma-Separated-Values (CSV) format,
rem  *              pipe CSV formatted records to an ASCII/Text file.
rem  *
     call SimoNOTE "StepInfo Create the 1st ASCII/Text File with CSV Record Format"
     set ZDTOTSD8=%BaseLib1%\DATA\TXT1\SIMOTIME.LSEQ.ZDTOTSD8.txt
     if exist %ZDTOTSD8% del %ZDTOTSD8%
rem  * ..:....1....:....2....:....3....:....4....:....5....:....6....:....7.
echo This is Record-001,1.23,13.33,765+,>%ZDTOTSD8%
echo This is Record-002,4.56,122.22,21-,>>%ZDTOTSD8%
echo This is Record-003,7.89,1231.11,44-,>>%ZDTOTSD8%
echo This is Record-004,1234567890.12,10.00,145+,>>%ZDTOTSD8%
echo This is Record-005,12.00,10.00,100+,>>%ZDTOTSD8%
echo This is Record-006,1234567.89,10.00,200+,>>%ZDTOTSD8%
echo This is Record-007,39.95,10.00,300+,>>%ZDTOTSD8%
echo This is Record-008,123.45,10.00,875-,>>%ZDTOTSD8%
     if exist %ZDTOTSD8% call SimoNOTE "DataMake %ZDTOTSD8%"
     if not exist %ZDTOTSD8% set JobStatus=9001
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
rem  * Step 2 of 4, Convert ASCII/TEXT file to ASCII RSEQ File.
rem  *              Read CSV formatted ASCII/Text file,
rem  *              Write Fixed-Field-Length Record Sequential file
rem  *
     call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential"
     set ZDTOTSD1=%BaseLib1%\DATA\Asc1\SIMOTIME.RSEQ.ZDTOTSD1.DAT
     if exist %ZDTOTSD1% del %ZDTOTSD1%
     run ZDTOTSC8
     if not "%ERRORLEVEL%" == "0" set JobStatus=0020
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "DataTake %ZDTOTSD8%"
     call SimoNOTE "DataMake %ZDTOTSD1%"
rem  *
rem  * *******************************************************************
rem  * Step 3 of 4, Create and populate the 2nd ASCII/TEXT file.
rem  *              Use instream data of a Comma-Separated-Values (CSV) format,
rem  *              pipe CSV formatted records to an ASCII/Text file.
rem  *
     call SimoNOTE "StepInfo Create an ASCII/Text File with CSV Record Format"
     set ZDTOTSD8=%BaseLib1%\DATA\TXT1\SIMOTIME.LSEQ.ZDTOTSD8.txt
     if exist %ZDTOTSD8% del %ZDTOTSD8%
rem  * ..:....1....:....2....:....3....:....4....:....5....:....6....:....7.
echo This is Record-001,1.23,13.33,765+,>%ZDTOTSD8%
echo This is Record-002,4.56,122.22,21-,>>%ZDTOTSD8%
echo This is Record-003,7.89,1231.11,44-,>>%ZDTOTSD8%
echo This is Record-004,1234567890.12,10.00,145+,>>%ZDTOTSD8%
echo This is Record-005,12.00,10.00,102+,>>%ZDTOTSD8%
echo This is Record-006,1234567.89,10.00,200+,>>%ZDTOTSD8%
echo This is Record-007,39.95,10.00,300+,>>%ZDTOTSD8%
echo This is Record-008,123.45,10.00,875-,>>%ZDTOTSD8%
     if exist %ZDTOTSD8% call SimoNOTE "DataMake %ZDTOTSD8%"
     if not exist %ZDTOTSD8% set JobStatus=9002
     if not %JobStatus% == 0000 goto :EojNok
rem  *
rem  * *******************************************************************
rem  * Step 4 of 4, Convert ASCII/TEXT file to ASCII RSEQ File.
rem  *              Read CSV formatted ASCII/Text file,
rem  *              Write Fixed-Field-Length Record Sequential file
rem  *
     call SimoNOTE "StepInfo Convert Line Sequential to Record Sequential"
     set ZDTOTSD1=%BaseLib1%\DATA\Asc1\SIMOTIME.RSEQ.ZDTOTSD2.DAT
     if exist %ZDTOTSD1% del %ZDTOTSD1%
     run ZDTOTSC8
     if not "%ERRORLEVEL%" == "0" set JobStatus=0030
     if not %JobStatus% == 0000 goto :EojNok
     call SimoNOTE "DataTake %ZDTOTSD8%"
     call SimoNOTE "DataMake %ZDTOTSD1%"
rem  *
rem  * *******************************************************************
:EojAok
     call SimoNOTE "Finished CmdName %CmdName%, Job Status is %JobStatus% "
     goto :End
:EojNok
     call SimoNOTE "ABENDING CmdName %CmdName%, Job Status is %JobStatus% "
:End
     if not "%1" == "nopause" pause

Table of Contents Previous Section Next Section Prepare

Before the jobs can be executed some preparation work will be required. The conversion programs need to be generated. Test data will need to be created. The environment will need to be configured. The programs will need to be compiled and the executable members will need to be promoted to the load library.

Table of Contents Previous Section Next Section Prepare Programs to Create Test Files

This section will describe the Process Control File and how it is used to generate and compile the programs that will create the test files used as input.

Table of Contents Previous Section Next Section The Process Control File

The following Process Control File (ZDTOTS08.pcf) is used to generate the programs that create the test files.

***********************************************************************
*                ZDTOTS08.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 should be an ASCII/Text, 80-byte, variable, text file.
* SYSUT2 should be an ASCII-encoded 80-byte, fixed-length, sequential.
***********************************************************************
* This set of specification will generate a callable COBOL routine that
* will IMPORT  data from an ASCII/Text file with the fields separated
* by a comma and update the item master file.
*
&SIMOPREP  call ..\..\ENV1BASE
&USERPREP  call USERCONV
&DIALECT   C2
&COPYFILE  ZDTOTSB1.cpy
&HTMLFILE  zdtotsb1.htm
*HEAD34    ....:....1....:....2....:....3....
&HEAD34    IMPORT  From RCSV to RSEQ/80
&PROGID    ZDTOTSC8
&SYSUT1    name=ZDTOTSD8 org=ASCII/Text recfm=VARIABLE rmax=80
&SYSUT2    name=ZDTOTSD1 org=Sequential recfm=FIXED    rlen=80
*
* 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 ,
&FRAME     "
*
* 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 input records.
*
&IMPCALL   ZDTOTSR8
&IMPREC    ZDTOTSD1-RECORD
&IMPLREC   80
&IMPFMT    CSV ,
*IMPINIT   SPACES
&IMPHDR    YES
*
&IMPORT    ZDTOTS01-ALPHA-01
&IMPORT    ZDTOTS01-VALUE-01
&IMPORT    ZDTOTS01-VALUE-02
&IMPORT    ZDTOTS01-VALUE-03
*
&END

Table of Contents Previous Section Next Section Generate the Programs

The SimoTime Technologies are used to generate the COBOL programs that will actually read a file and produce a report that contains summary totals for user-defined fields and a record count for the number of records in the file.

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.

Table of Contents Previous Section Next Section Compile the Programs

For the Micro Focus environment the programs are compiled using the following compiler directives.

DIALECT"MF"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
RTNCODE-SIZE"2"
ANIM
NOQUERY
NOOPTIONAL-FILE
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings
list()
noform

The following links will provide additional information about the Micro Focus compiler directives.

Link to Internet   Link to Server   Explore the Compiler Directives available for the Micro Focus COBOL technologies.

Table of Contents Previous Section Next Section Technical Details

This section provides additional details about the programs and control files that are used in this suite of programs.

Table of Contents Previous Section Next Section Record Structure for Test File

The file format for the test file is record sequential with a fixed record length of eighty (80) bytes. The record content has one text string and three (3) numeric fields that are defined as packed-decimal (or COMP-3) format.

Table of Contents Previous Section Next Section COBOL Copy File for Test File

The following source member (ZDTOTSB1.cpy) is the COBOL Copy File that defines the record structure for the test file.

      *****************************************************************
      *               ZDTOTSB1.cpy - a COBOL Copy File                *
      *         A Record Structure Containing Numeric Fields          *
      *           Zoned-Decimal Format or USAGE IS DISPLAY            *
      *       Used for Calculating and Testing CheckSum Totals        *
      *         Copyright (C) 1987-2019 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       *
      *****************************************************************
      *
       01  ZDTOTSD1-RECORD.                                             01-80
           05  ZDTOTS01-ALPHA-01 PIC X(32).                             01-32
           05  FILLER            PIC X.                                 33-33
           05  ZDTOTS01-VALUE-01 PIC 9(10)V99    USAGE IS DISPLAY.      34-45
           05  FILLER            PIC X.                                 46-46
           05  ZDTOTS01-VALUE-02 PIC 9(8)V999.                          47-57
           05  FILLER            PIC X.                                 58-58
           05  ZDTOTS01-VALUE-03 PIC S9(5).                             59-63
           05  FILLER            PIC X.                                 64-64
           05  FILLER            PIC X(16).                             65-80
      *
      *    Note: Since "USAGE IS DISPLAY" is the default format for
      *          numeric fields (i.e. PIC 9) it is typically not
      *          explicitly coded.
      *
      ***  ZDTOTSB1 - End-of-Copy File - - - - - - - - - - - ZDTOTSB1 *
      *****************************************************************
      *

Table of Contents Previous Section Next Section HTML Document for Test File

The SimoTime Technologies have the ability to scan a COBOL copy file and create an HTML document of a record structure or record layout. The HTML documentation provides information that is not easy to obtain by viewing the COBOL copy file. For example, the physical position of a field within a record as calculated during the copy file scan and placed in the HTML document.

Link to Internet   Link to Server   Explore an HTML document that describes the Record Structure of the Test File used by the job that accumulates Summary Totals and calculates a record count. The numeric fields are zoned-decimal (or USAGE IS DSPLAY) format. The record structure and generated HTML document for this file are based on a User-Supplied COBOL copyfile.

Table of Contents Previous Section Next Section COBOL Compiler Directives

The following is the Micro Focus Compiler Directives are used to compile the programs that create the test files.

DIALECT"MF"
CHARSET"ASCII"
ASSIGN"EXTERNAL"
IDXFORMAT"8"
IBMCOMP
NOTRUNC
RTNCODE-SIZE"2"
NOOPTIONAL-FILE
NOHOSTFD
NOQUERY
COBIDY
NOANIM
outdd"SYSOUT 121 L"
SHARE-OUTDD
DATAMAP
settings
list()
noform

Table of Contents Previous Section Next Section Summary

The purpose of this document is to assist as a tutorial for new programmers or as a quick reference for experienced programmers that are interested in improving their testing process by leveraging additional functionality and data validation techniques.

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 An Enterprise System Model that describes and demonstrates how Applications that were running on a Mainframe System and non-relational data that was located on the Mainframe System were copied and deployed in a Microsoft Windows environment with Micro Focus Enterprise Server.

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

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

Link to Internet   Link to Server   Explore an Extended List of Software Technologies that are available for review and evaluation. The software technologies (or Z-Packs) provide individual programming examples, documentation and test data files in a single package. The Z-Packs are usually in zip format to reduce the amount of time to download.

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

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

Table of Contents Previous Section Next Section Internet Access Required

The following links will require an internet connection.

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.

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
Create Sequential File with Zoned Decimal Numeric Values
Copyright © 1987-2024
SimoTime Technologies and Services
All Rights Reserved
When technology complements business
http://www.simotime.com