|
|||||
|
This session explains how to generate documentation for a record layout (or record structure) based on the definitions in a COBOL copy file. This documentation may be used to determine the COBOL field name that relates to a position or location within a record.
| 1. | Demonstrate how to create a new (or use an existing) command line script to generate the HTML documentation for a record layout from a COBOL copy file. |
| 2. | Describe how to view the generated HTML documentation. |
Note: This module is part of The SimoPATH Series of training and reference materials. For more information refer to The Home Page for The SimoPATH Series.
Each record in a non-relational data file (i.e. a sequential file or a Key-Sequenced-Data-Set (also referred to as KSDS)) usually has a unique data structure that is defined in a COBOL copy file. The problem is the COBOL copy file defines the field names as unique and independent entities. The relationship of the individual fields within a record must be manually calculated. The generated HTML documentation will define the individual fields (i.e their logical and physical field lengths) and their relationship within the record (i.e their position within the record).
This self-study exercise will use a previously created command file to generate the HTML documentation for the record layout that will be use during the data file compare process when a difference is identified by position within a record.
| 1. | From the Windows Explorer select the C:\DataMig1\CMDS directory. |
| 2. | Highlight the zCrtHtm1.CMD then select the "Edit"
item from the context menu. Note: Do not double-click on this item, this would cause the command file to execute. |
Notepad should display the records within the command file. This is discussed in more detail in the following section.
The following shows the content of the command file used to generate the HTML documentation. Notepad was used to display the following information.
@echo off
rem * *******************************************************************
rem * This program is provided by: *
rem * SimoTime Enterprises, LLC *
rem * (C) Copyright 1987-2006 All Rights Reserved *
rem * Web Site URL: http://www.simotime.com *
rem * e-mail: helpdesk@simotime.com *
rem * *******************************************************************
rem *
rem * Text - Create HTML docuemntation from a COBOL copy file.
rem * Author - SimoTime Enterprises
rem * Date - January 24, 1996
rem *
rem * The SimoEXEC is a driver program. This program will read the Windows
rem * command line to get the command line parameters.
rem *
rem * If the first parameter is "NOTE" then SimoEXEC will write the
rem * remaining parameters on the command line to a log file and display
rem * the information on the screen. This provides an audit or validation
rem * trail to identify a success or failure of the compile.
rem *
rem * If the first parameter is "EXEC" then it will use the second parameter
rem * as a program name and call the program. For the EXEC function the
rem * driver will look for a PARM= keyword and pass the value of the PARM=
rem * to the called program in a format that is similar to the way the PARM=
rem * is passed from mainframe JCL to a called (or EXECuted) program.
rem *
rem * Create HTML docuemntation from a COBOL copy file.
rem *
setlocal
call EnvDev01.CMD
rem *
SimoEXEC NOTE *******************************************************zCrtHtm1.CMD
SimoEXEC NOTE Starting JobName zCrtHtm1.CMD
SimoEXEC NOTE Abstract Create HTML Documentation from a COBOL Copy File
rem *
rem * *******************************************************************
rem * Call the inline procedure to compile the COBOL programs and return.
rem *
SimoEXEC NOTE Starting JobStep Create HTML Documentation from COBOL Copy File.
CALL :CreateHTML %BaseLib1%\CobCpy1\ItemCB01.CPY %BaseLib1%\HTML\itemcb01.htm
rem *
SimoEXEC NOTE Produced LogFile %SYSLOG%
if "%JobStatus%" == "0000" goto :EOJAOK
goto :EOJNOK
rem *
rem * *******************************************************************
rem * Create a single HTML document from a COBOL copy file.
rem * The :EOF causes a return to caller within this CMD.
:CreateHTML
set CreateHTMLStatus=0000
if exist %2 erase %2
call Rec1HTML %1 %2 IBM NOPAUSE
if ERRORLEVEL = 1 set CreateHTMLStatus=0010
if not "%CreateHTMLStatus%" == "0000" goto :StepNOK
rem *
if exist %2 goto :CreateHTMLAOK
set CreateHTMLStatus=0020
goto :CreateHTMLNOK
:CreateHTMLNOK
set JobStatus=%Compile2DLLStatus%
SimoEXEC NOTE ABENDING JobStep Compile Step, Status is %CreateHTMLStatus%, Program is %1
goto :EOF
:CreateHTMLAOK
SimoEXEC NOTE Complete JobStep Compile Step, Status is %CreateHTMLStatus%, Program is %1
goto :EOF
rem *
rem * *******************************************************************
:EOJAOK
SimoEXEC NOTE Finished JobName zCrtHtm1.CMD
goto :END
rem * *******************************************************************
:EOJNOK
SimoEXEC NOTE ABENDING JobName zCrtHtm1.CMD
SimoEXEC NOTE The SYSLOG file is displayed in a separate Window using NotePAD.
start NotePad %SYSLOG%
pause
rem * *******************************************************************
:END
EndLocal
rem * pause
The preceding listing shows the records in the command file. The comments (or REMarks) explain the purpose of each step in the job that compiles the programs and writes the information to a log file.
To execute (or run) the command file script simple double click on the item from the following Windows Explorer screen.
| 1. | Select the "c:\DataMig1\CMDS" directory. |
| 2. | Double click on the "zCrtHtm1.CMD" item. |
The command file should execute and compile the COBOL source code. The ITUTL3C1.DLL should be placed in the c:\DataMig1\DLLS directory.
To view the SYSLOG file to verify the execution of the job to generate the HTML documentation do the following.
| 1. | Select the "c:\DataMig1\LOGS" directory. |
| 2. | Double click on the "SysLog01.TXT" item. |
Notepad should display the following information (scroll to the end of the file to view the latest entries).
Sat 02/25/2006 0:14:01.00 Starting JobName EnvDev01.CMD Sat 02/25/2006 0:14:01.01 Finished JobName EnvDev01.CMD *** 2006/02/25 00:14:01:04 *******************************************************zCrtHtm1.CMD *** 2006/02/25 00:14:01:09 Starting JobName zCrtHtm1.CMD *** 2006/02/25 00:14:01:12 Abstract Create HTML Documentation from a COBOL Copy File *** 2006/02/25 00:14:01:15 Starting JobStep Create HTML Documentation from COBOL Copy File. *** 2006/02/25 00:14:01:76 Complete JobStep Compile Step, Status is 0000, Program is c:\DataMig1\CobCpy1\ItemCB01.CPY *** 2006/02/25 00:14:01:81 Produced LogFile c:\DataMig1\LOGS\SysLog01.TXT *** 2006/02/25 00:14:01:85 Finished JobName zCrtHtm1.CMD
In the preceding list notice the 7th and 9th records that are high-lighted. These statements verify the normal completion of the job step that created the HTML documentation and the normal completion of the job.
The following is additional reading material and provides an example of the copy file and the HTML output. The information in the HTML document that is created based on the field definitions in a COBOL copy file will be very useful when trying to relate a position of failure within a record to an actual COBOL field name.
The COBOL copy file that defines the structure of a record layout is used to generate the HTML documentation. The following is an example of a COBOL copy file.
*****************************************************************
* Copy File for Item Master File used by the Demo programs. *
* This is a VSAM Keyed=Sequential-Data-Set or Key-Indexed File. *
*****************************************************************
* Copyright (C) 1987-2004 SimoTime Enterprises *
* All Rights Reserved *
*****************************************************************
* Provided by SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
*****************************************************************
01 ITEM-RECORD.
05 ITEM-NUMBER PIC X(12).
05 ITEM-DATA.
10 ITEM-DESCRIPTION PIC X(48).
10 ITEM-QTY-ONHAND PIC 9(7) COMP.
10 ITEM-QTY-ALLOCATED PIC 9(7) COMP.
10 ITEM-UNIT-OF-MEASURE PIC X(16).
10 ITEM-COST PIC S9(7)V9(2) COMP-3.
10 ITEM-PRICE PIC S9(7)V9(2) COMP-3.
10 ITEM-LADATE PIC X(8).
10 ITEM-LATIME PIC X(8).
10 ITEM-TOKEN PIC X(3).
10 ITEM-D-CODE-1 PIC X.
10 ITEM-D-PERCENT-1 PIC S9(3)V9(4).
10 ITEM-D-CODE-2 PIC X.
10 ITEM-D-PERCENT-2 PIC S9(3)V9(4).
10 ITEM-D-CODE-3 PIC X.
10 ITEM-D-PERCENT-3 PIC S9(3)V9(4).
10 FILLER PIC X(375).
*! ITEMREC1 - End-of-Copy File...
Performing this task will also generate an HTML document that describes the record layout based upon the copy file definition of the record structure. The HTML document will provide field position within the record and field lengths (both logical which is based on the PIC and physical which is based on the COMP or COMP-3). This task is optional but recommended. The HTML document will be used to relate the position within the record where the failure occurred to the actual COBOL field name.
The purpose of this document is to show how to generate HTML documentation for a record layout based on the definitions in a COBOL copy file.
Permission to use, copy, modify and distribute this software, documentation or training material for any purpose requires a fee to be paid to SimoTime Enterprises. 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 Enterprises.
SimoTime Enterprises 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 express or implied warranty, including the implied warranties of merchantability, fitness for a particular purpose and non-infringement. SimoTime Enterprises shall not be liable for any direct, indirect, special or consequential damages resulting from the loss of use, data or projects, whether in an action of contract or tort, arising out of or in connection with the use or performance of this software, documentation or training material.
The Home Page for The SimoPATH Series is the starting point to view information about training sessions and learning materials available from SimoTime Enterprises.
The SimoZAPS Utility Program has the capability of generating a COBOL program that will do the conversion of sequential and VSAM (KSDS) files between EBCDIC and ASCII. SimoZAPS can also read a sequential file in EBCDIC format and create an ASCII/CRLF file or VSAM KSDS file in ASCII format. The conversion tables may be viewed or modified to meet unique requirements. The Hexcess/2 function provides the capability of viewing, finding or patching the contents of a file in hexadecimal.
This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.
Check out The VSAM - QSAM Connection for more examples of mainframe VSAM and QSAM accessing techniques and sample code.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The SimoTime Library for a wide range of topics for Programmers, Project Managers and Software Developers.
To review all the information available on this site start at The SimoTime Home Page .
Check out The SimoTime Glossary for a list of terms and definitions used in the documents provided by SimoTime.
If you have any questions, suggestions or comments please call or send an e-mail to: helpdesk@simotime.com
We appreciate your comments and feedback.
Founded in 1987, SimoTime Enterprises is a privately owned, Limited Liability Corporation located in Novato, California. 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. This includes the smallest thin client using the Internet and the very large mainframe systems. There is more to making the Internet work for your company's business than just having a nice looking WEB site. It is about combining the latest technologies and existing technologies with practical business experience. It's about the business of doing business and looking good in the process. 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. 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 |
| Copyright © 1987-2007 SimoTime Enterprises, LLC All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |