|
|
Data File
Comparison View COBOL Source Code http://www.simotime.com |
| When technology complements business | Copyright © 1987-2010 SimoTime Enterprises All Rights Reserved |
This document describes how to view and validate the generation of the COBOL source code for the program that will read two files record by record and compare the contents of each corresponding record. Since the COBOL source code is COBOL/2 compliant it may be compiled and executed on an IBM Mainframe (z/OS or VSE), a Wintel platform (Windows and Micro Focus) or a UNIX platform (with Micro Focus).
This example illustrates the following functions.
| 1. | Demonstrate how to view (or edit) the generated COBOL source code created by the Generation process. |
| 2. | Demonstrate how to view the HTML document created during the generation process. |
| 3. | Demonstrate how to create a new (or use an existing) file of specifications that will be used to generate the compare program. |
| 4. | Demonstrate how to execute a new (or execute an existing) command file to automate and document the process. |
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.
Generating the COBOL source code to do the data file comparison is a two step process. The first step is to create the comparison program. The second step is to create the HTML document to bo used to relate the positions of differences to the field names used in the COBOL copy file.
The following source member should be displayed using Notepad.
IDENTIFICATION DIVISION.
PROGRAM-ID. ITUTL3C1.
AUTHOR. SIMOTIME ENTERPRISES.
*****************************************************************
* This program was generated by SimoZAPS *
* A product of SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
* *
* Generation Date: 2006-02-15 Generation Time: 22:09:09:59 *
* *
* Record Record Key *
* Function Name Organization Format Max-Min Pos-Len *
* INPUT SYSUT1 INDEXED VARIABLE 00512 00001 *
* 00012 *
* OUTPUT SYSUT2 INDEXED VARIABLE 00512 00001 *
* 00012 *
* *
* Translation Mode is UNKNOWN *
* *
*****************************************************************
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SYSUT1-FILE ASSIGN TO SYSUT1
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS SYSUT1-KEY-01
FILE STATUS IS SYSUT1-STATUS.
SELECT SYSUT2-FILE ASSIGN TO SYSUT2
ORGANIZATION IS INDEXED
ACCESS MODE IS SEQUENTIAL
RECORD KEY IS SYSUT2-KEY-01
FILE STATUS IS SYSUT2-STATUS.
SELECT SYSUT3-FILE ASSIGN TO SYSUT3
ORGANIZATION IS LINE SEQUENTIAL
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS SYSUT3-STATUS.
*****************************************************************
DATA DIVISION.
FILE SECTION.
FD SYSUT1-FILE
DATA RECORD IS SYSUT1-REC
.
01 SYSUT1-REC.
05 SYSUT1-KEY-01 PIC X(00012).
05 SYSUT1-DATA-01 PIC X(00500).
FD SYSUT2-FILE
DATA RECORD IS SYSUT2-REC
.
01 SYSUT2-REC.
05 SYSUT2-KEY-01 PIC X(00012).
05 SYSUT2-DATA-01 PIC X(00500).
FD SYSUT3-FILE
DATA RECORD IS SYSUT3-REC
.
01 SYSUT3-REC.
05 SYSUT3-DATA-01 PIC X(80).
*****************************************************************
* This program was created using the SYSCOMP2.TXT file as the *
* template for the data file comparison. The positions to be *
* compared are determined by reading a control file at *
* execution time. *
* *
* For more information or questions please contact SimoTime *
* Enterprises as follows. *
* *
* 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 '* ITUTL3C1 '.
05 T2 pic X(34) value 'Data File Content Comparison '.
05 T3 pic X(10) value 'v05.12.23 '.
05 T4 pic X(24) value ' http://www.simotime.com'.
01 SIM-COPYRIGHT.
05 C1 pic X(11) value '* ITUTL3C1 '.
05 C2 pic X(20) value 'Created by SimoZAPS,'.
05 C3 pic X(20) value ' a utility package '.
05 C4 pic X(28) value 'of SimoTime Enterprises, LLC'.
01 SYSUT1-STATUS.
05 SYSUT1-STATUS-L pic X.
05 SYSUT1-STATUS-R pic X.
01 SYSUT1-EOF pic X value 'N'.
01 SYSUT1-OPEN-FLAG pic X value 'C'.
01 SYSUT2-STATUS.
05 SYSUT2-STATUS-L pic X.
05 SYSUT2-STATUS-R pic X.
01 SYSUT2-EOF pic X value 'N'.
01 SYSUT2-OPEN-FLAG pic X value 'C'.
01 SYSUT3-STATUS.
05 SYSUT3-STATUS-L pic X.
05 SYSUT3-STATUS-R pic X.
01 SYSUT3-EOF pic X value 'N'.
01 SYSUT3-OPEN-FLAG pic X value 'C'.
*****************************************************************
* 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-TEXT routine. *
*****************************************************************
01 MESSAGE-BUFFER.
05 MESSAGE-HEADER pic X(11) value '* ITUTL3C1 '.
05 MESSAGE-TEXT.
10 MESSAGE-TEXT-1 pic X(68) value SPACES.
10 MESSAGE-TEXT-2 pic X(188) value SPACES.
*****************************************************************
01 APPL-RESULT pic S9(9) comp.
88 APPL-AOK value 0.
88 APPL-EOF value 16.
01 READ-FLAGS.
05 READ-1 pic X value 'Y'.
05 READ-2 pic X value 'Y'.
01 DUMP-FLAGS.
05 DUMP-ASC pic X value 'Y'.
05 DUMP-EBC pic X value 'Y'.
05 DUMP-HEX pic X value 'Y'.
01 COMPARE-STATUS pic XX value 'EQ'.
01 FLAG-EQ pic XX value 'EQ'.
01 FLAG-NE pic XX value 'NE'.
01 FLAG-QT pic XX value 'QT'.
01 DELTA-LINE pic X(1024) value all '-'.
01 PTR-1 pic 9(5) value 0.
01 PTR-2 pic 9(5) value 0.
01 IDX-2 pic 9(5) value 0.
01 DELTA-MAXIMUM-X pic X(5) value '00250'.
01 DELTA-MAXIMUM redefines DELTA-MAXIMUM-X pic 9(5).
01 DELTA-PROCESS pic X(4) value 'EOF '.
01 YES-YES pic XX value 'YY'.
01 N-BYTE pic X value 'N'.
01 Y-BYTE pic X value 'Y'.
01 KEY-ACTIVE pic X value 'Y'.
01 KEY-CONTROL-1.
05 PS-1 pic 9(5) value 00001.
05 LN-1 pic 9(5) value 00012.
01 KEY-CONTROL-2.
05 PS-2 pic 9(5) value 00001.
05 LN-2 pic 9(5) value 00012.
01 SYSUT1-LRECL pic 9(5) value 00512.
01 SYSUT2-LRECL pic 9(5) value 00512.
01 D-LEN pic 9(5) value 128.
01 D-POS pic 9(5) value 1.
01 ASC-OR-EBC pic 9(3) comp value 0.
01 ASC-OR-EBC-R redefines ASC-OR-EBC.
05 ASC-A pic X.
05 EBC-A pic X.
* Header row for positional indicator...
01 DUMP-H10.
05 FILLER pic X(5) value '....:'.
05 POS-NO pic 9(5) value 10.
01 DUMP-HEADER pic X(1024) value all '.'.
01 D-P1 pic 9(5) value 0.
01 RECORD-HEADER.
05 RECORD-ID pic X(8) value 'SYSUT1 '.
05 filler pic X(2) value '..'.
05 REC-NUMBER pic 9(9) value 0.
05 filler pic X value '('.
05 RECORD-POS pic 9(5) value 0.
05 filler pic X value ':'.
05 RECORD-LEN pic 9(5) value 0.
05 filler pic X value ')'.
01 BANNER-STARS.
05 filler pic X(128) value all '*'.
01 BANNER-TEXT.
05 filler pic X(2) value '* '.
05 filler pic X(49) value is SPACES.
05 filler pic X(26) value 'Data File Content Compare '.
05 filler pic X(49) value is SPACES.
05 filler pic X(2) value ' *'.
01 INFO-STATEMENT.
05 INFO-SHORT.
10 INFO-ID pic X(8) value 'Starting'.
10 filler pic X(32)
value ' - Data File Content Comparison'.
05 filler pic X(32)
value ' by SimoTime Enterprises, LLC '.
01 SYSUT1-TOTAL.
05 SYSUT1-RDR pic 9(9) value 0.
05 filler pic X(3) value ' - '.
05 filler pic X(25) value 'Record count for SYSUT1 '.
01 SYSUT2-TOTAL.
05 SYSUT2-RDR pic 9(9) value 0.
05 filler pic X(3) value ' - '.
05 filler pic X(25) value 'Record count for SYSUT2 '.
01 SYSUT3-TOTAL.
05 SYSUT3-RDR pic 9(9) value 0.
05 filler pic X(3) value ' - '.
05 filler pic X(25) value 'Record count for SYSUT3 '.
01 COMPARE-NE-TOTAL.
05 COMPARE-NE pic 9(9) value 0.
05 filler pic X(3) value ' - '.
05 filler pic X(23) value 'Unequal count'.
01 FORMAT-TYPE pic X value 'B'.
01 WORK-05-X.
05 WORK-05-N pic 9(5).
01 COMPARE-TABLE.
05 POS-1 pic 9(5) value 0 occurs 32 times.
05 LEN-1 pic 9(5) value 0 occurs 32 times.
05 POS-2 pic 9(5) value 0 occurs 32 times.
05 LEN-2 pic 9(5) value 0 occurs 32 times.
01 CX-LIMIT pic 9(3) value 32.
01 CX-1 pic 9(3) value 0.
01 PARSE-TABLE.
05 PT-OSET pic 9(3) value 0 occurs 15 times.
05 PT-SIZE pic 9(3) value 0 occurs 15 times.
01 PT-LIMIT pic 9(3) value 15.
01 PX-1 pic 9(3) value 0.
01 PX-2 pic 9(3) value 0.
01 PX-MAX-ITEMS pic 9(3) value 15.
01 PX-ACTIVE pic 9(3) value 0.
01 PX-BUFFER-SIZE pic 9(3) value 80.
01 PX-LAST-SIG-BYTE pic 9(5) value 0.
01 B-COUNT pic 9(3) value 0.
01 COMPARE-MSG-DATA.
05 FILLER pic X(30) value 'Error, /COMPARE '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT1 '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT1 POS '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT1 POS nnn'.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT1 LEN '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT1 LEN nnn'.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT2 '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT2 POS '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT2 POS nnn'.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT2 LEN '.
05 FILLER pic X(30) value 'Error, /COMPARE SYSUT2 LEN nnn'.
01 COMPARE-MSG-DATA-R redefines COMPARE-MSG-DATA.
05 COMPARE-MSG pic X(30) occurs 11 times.
01 U-CASE pic X(26) value 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
01 L-CASE pic X(26) value 'abcdefghijklmnopqrstuvwxyz'.
COPY PASSHEX4.
COPY PASSLOGS.
*****************************************************************
PROCEDURE DIVISION.
perform JOB-STARTING
perform
until COMPARE-STATUS = 'QT'
or SYSUT1-STATUS not = '00'
or SYSUT2-STATUS not = '00'
if READ-1 = 'Y'
perform SYSUT1-READ
end-if
if READ-2 = 'Y'
perform SYSUT2-READ
end-if
if SYSUT1-STATUS = '00'
and SYSUT2-STATUS = '00'
move 'EQ' to COMPARE-STATUS
if KEY-ACTIVE = 'Y'
perform COMPARE-KEYS
end-if
if COMPARE-STATUS = FLAG-EQ
perform COMPARE-RECORDS
end-if
if COMPARE-STATUS = FLAG-NE
add 1 to COMPARE-NE
end-if
end-if
if DELTA-PROCESS = 'QUIT'
and COMPARE-NE > DELTA-MAXIMUM
move 'The Not Equal count exceeds Maximum limit...'
to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
end-perform
perform JOB-FINISHED
GOBACK.
*****************************************************************
COMPARE-RECORDS.
* Compare using SYSUT3 parameters...
add 1 to ZERO giving CX-1
perform until CX-1 > CX-LIMIT
if SYSUT1-REC(POS-1(CX-1):LEN-1(CX-1))
not = SYSUT2-REC(POS-2(CX-1):LEN-2(CX-1))
move FLAG-NE to COMPARE-STATUS
if COMPARE-NE < DELTA-MAXIMUM
add POS-1(CX-1) to ZERO giving D-POS
add POS-1(CX-1) to ZERO giving RECORD-POS
add LEN-1(CX-1) to ZERO giving D-LEN
add LEN-1(CX-1) to ZERO giving PASSHEX4-LENGTH
add LEN-1(CX-1) to ZERO giving RECORD-LEN
perform DUMP-PRIMARY-RECORD
add POS-2(CX-1) to ZERO giving D-POS
add POS-2(CX-1) to ZERO giving RECORD-POS
add LEN-2(CX-1) to ZERO giving D-LEN
add LEN-2(CX-1) to ZERO giving PASSHEX4-LENGTH
add LEN-2(CX-1) to ZERO giving RECORD-LEN
perform DUMP-SECONDARY-RECORD
perform DUMP-POSITION-DIFFERENCE
end-if
end-if
if READ-FLAGS not = 'YY'
add CX-LIMIT to 1 giving CX-1
else
add 1 to CX-1
end-if
end-perform
exit.
*****************************************************************
COMPARE-KEYS.
move YES-YES to READ-FLAGS
if SYSUT1-REC(PS-1:LN-1)
< SYSUT2-REC(PS-2:LN-2)
move N-BYTE to READ-2
end-if
if SYSUT1-REC(PS-1:LN-1)
> SYSUT2-REC(PS-2:LN-2)
move N-BYTE to READ-1
end-if
exit.
*****************************************************************
DUMP-TO-LOG.
*> HexDump...
* Dump DD Name, Record-Number, (position,length)
move RECORD-HEADER to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
* DUMP position indicator
perform DUMP-POSITION-INDICATOR
if DUMP-ASC = 'Y'
move PASSHEX4-ASCII(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
end-if
if DUMP-HEX = 'Y'
move PASSHEX4-UPPER(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move PASSHEX4-LOWER(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
end-if
if DUMP-EBC = 'Y'
move PASSHEX4-EBCDIC(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
end-if
exit.
*****************************************************************
* Build the position header row...
*****************************************************************
DUMP-POSITION-INDICATOR.
add 9 to D-POS giving POS-NO
perform varying D-P1 from 1 by 10 until D-P1 > 1020
move DUMP-H10 to DUMP-HEADER(D-P1:10)
inspect DUMP-HEADER(D-P1 + 5:5)
replacing leading ZEROES by '.'
add 10 to POS-NO
end-perform
move DUMP-HEADER(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
exit.
*****************************************************************
DUMP-PRIMARY-RECORD.
move SPACES to PASSHEX4-SOURCE
if READ-1 = 'Y'
and SYSUT1-EOF = 'N'
move 'SYSUT1..' to RECORD-ID
add SYSUT1-RDR to ZERO giving REC-NUMBER
move SYSUT1-REC(D-POS:D-LEN) to PASSHEX4-SOURCE
call 'SIMOHEX4' using PASSHEX4-PASS-AREA
perform DUMP-TO-LOG
else
move 'SYSUT1..Record is missing from SYSUT1 file'
to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
end-if
exit.
*****************************************************************
DUMP-SECONDARY-RECORD.
move SPACES to PASSHEX4-SOURCE
if READ-2 = 'Y'
and SYSUT2-EOF = 'N'
move 'SYSUT2..' to RECORD-ID
add SYSUT2-RDR to ZERO giving REC-NUMBER
move SYSUT2-REC(D-POS:D-LEN) to PASSHEX4-SOURCE
call 'SIMOHEX4' using PASSHEX4-PASS-AREA
perform DUMP-TO-LOG
else
move 'SYSUT2..Record is missing from SYSUT2 file'
to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
exit.
*****************************************************************
DUMP-POSITION-DIFFERENCE.
if READ-FLAGS = 'YY'
move all '-' to DELTA-LINE
add POS-1(CX-1) to ZERO giving PTR-1
add POS-2(CX-1) to ZERO giving PTR-2
add 1 to ZERO giving IDX-2
perform until IDX-2 > 1024
or IDX-2 > D-LEN
if SYSUT1-REC(PTR-1:1)
= SYSUT2-REC(PTR-2:1)
move '=' to DELTA-LINE(IDX-2:1)
else
move '#' to DELTA-LINE(IDX-2:1)
end-if
add 1 to PTR-1
add 1 to PTR-2
add 1 to IDX-2
end-perform
else
move all '#' to DELTA-LINE
end-if
move DELTA-LINE(1:D-LEN) to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move '*' to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
exit.
*****************************************************************
JOB-FINISHED.
perform SYSUT2-CLOSE
perform SYSUT1-CLOSE
move 'Summary ' to INFO-ID
move INFO-SHORT to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move SYSUT1-TOTAL to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move SYSUT2-TOTAL to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
if SYSUT1-RDR not = SYSUT2-RDR
move 'WARNING! - Record counts are not equal'
to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
end-if
move COMPARE-NE-TOTAL to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
if SYSUT1-EOF = 'Y'
and SYSUT2-EOF = 'Y'
move 'Finished' to INFO-ID
else
move 'ABENDING' to INFO-ID
end-if
move INFO-STATEMENT to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
if COMPARE-NE > 0
or SYSUT1-RDR not = SYSUT2-RDR
add 4 to ZERO giving RETURN-CODE
end-if
exit.
*****************************************************************
JOB-STARTING.
perform Z-POST-COPYRIGHT
perform Z-DETERMINE-ENVIRONMENT
perform JOB-STARTING-GET-CONTROL
perform SYSUT1-OPEN
perform SYSUT2-OPEN
move 'Y' to READ-1
move 'Y' to READ-2
if DELTA-MAXIMUM not numeric
add 100 to ZERO giving DELTA-MAXIMUM
end-if
if PS-1 > 0
and PS-2 > 0
and LN-1 > 0
and LN-2 > 0
move 'Y' to KEY-ACTIVE
move 'Key control is ENABLED...'
to MESSAGE-TEXT
else
move 'N' to KEY-ACTIVE
move 'Key control is NOT enabled...'
to MESSAGE-TEXT
end-if
perform Z-DISPLAY-MESSAGE-TEXT
move 'DUMP' to PASSHEX4-REQUEST
add 128 to ZERO giving PASSHEX4-LENGTH
move 'NOTE' to SIMOLOGS-REQUEST
move SPACES to SIMOLOGS-MESSAGE
move BANNER-STARS to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move INFO-STATEMENT to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
move BANNER-STARS to SIMOLOGS-MESSAGE
call 'SIMOLOGS' using SIMOLOGS-PASS-AREA
exit.
*****************************************************************
JOB-STARTING-GET-CONTROL.
perform SYSUT3-OPEN
perform INITIALIZE-TABLE-CX
perform until SYSUT3-STATUS not = '00'
perform SYSUT3-READ
if SYSUT3-STATUS = '00'
display SYSUT3-REC upon console
perform INITIALIZE-TABLE-PX
inspect SYSUT3-REC converting L-CASE to U-CASE
perform PARSE-BUFFER
perform PROCESS-CONTROL-RECORD
else
if SYSUT3-EOF = 'Y'
move 'SYSUT3 at EOF...' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
end-if
end-if
end-perform
add CX-1 to ZERO giving CX-LIMIT
perform SYSUT3-CLOSE
exit.
*****************************************************************
INITIALIZE-TABLE-CX.
add 1 to ZERO giving CX-1
perform until CX-1 > CX-LIMIT
move 0 to POS-1(CX-1)
move 0 to LEN-1(CX-1)
move 0 to POS-2(CX-1)
move 0 to LEN-2(CX-1)
add 1 to CX-1
end-perform
move ZERO to RETURN-CODE
subtract CX-1 from CX-1
exit.
*****************************************************************
INITIALIZE-TABLE-PX.
add 1 to ZERO giving PX-1
perform until PX-1 > PT-LIMIT
move 0 to PT-OSET(PX-1)
move 0 to PT-SIZE(PX-1)
add 1 to PX-1
end-perform
add 1 to ZERO giving PX-1
add 1 to ZERO giving PX-2
exit.
*****************************************************************
PARSE-BUFFER.
if SYSUT3-REC(PX-1:1) not = SPACE
add PX-1 to ZERO giving PX-LAST-SIG-BYTE
end-if
perform until PX-1 > PX-BUFFER-SIZE
if SYSUT3-REC(PX-1:1) = SPACE
add 1 to B-COUNT
if B-COUNT = 1
and PT-SIZE(PX-2) > 0
if PX-2 < PX-MAX-ITEMS
add 1 to PX-2
add 1 to PX-MAX-ITEMS
else
move PX-BUFFER-SIZE to PX-2
end-if
end-if
else
subtract B-COUNT from B-COUNT
add 1 to PT-SIZE(PX-2)
if PT-SIZE(PX-2) = 1
move PX-1 to PT-OSET(PX-2)
end-if
end-if
add 1 to PX-1
end-perform
exit.
*****************************************************************
PROCESS-CONTROL-RECORD.
add 1 to ZERO giving PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 8
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1)) = '/COMPARE'
perform PROCESS-CONTROL-RECORD-COMPARE
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
exit.
*****************************************************************
PROCESS-CONTROL-RECORD-COMPARE.
add 1 to CX-1
add 2 to ZERO giving PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 6
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'SYSUT1'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 3
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'POS'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) < 6
move SPACES to WORK-05-X
move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
to WORK-05-X
perform RIGHT-ADJUST-05
if WORK-05-X is NUMERIC
add WORK-05-N to ZERO giving POS-1(CX-1)
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 3
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'LEN'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) < 6
move SPACES to WORK-05-X
move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
to WORK-05-X
perform RIGHT-ADJUST-05
if WORK-05-X is NUMERIC
add WORK-05-N to ZERO giving LEN-1(CX-1)
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 6
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'SYSUT2'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 3
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'POS'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) < 6
move SPACES to WORK-05-X
move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
to WORK-05-X
perform RIGHT-ADJUST-05
if WORK-05-X is NUMERIC
add WORK-05-N to ZERO giving POS-2(CX-1)
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) = 3
if SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
not = 'LEN'
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
add 1 to PX-1
if PT-OSET(PX-1) > ZERO
and PT-SIZE(PX-1) < 6
move SPACES to WORK-05-X
move SYSUT3-REC(PT-OSET(PX-1):PT-SIZE(PX-1))
to WORK-05-X
perform RIGHT-ADJUST-05
if WORK-05-X is NUMERIC
add WORK-05-N to ZERO giving LEN-2(CX-1)
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
else
move COMPARE-MSG(PX-1) to MESSAGE-TEXT
perform Z-ABEND-PROGRAM
end-if
exit.
*****************************************************************
RIGHT-ADJUST-05.
if WORK-05-X(5:1) = SPACES
perform until WORK-05-X(5:1) not = SPACE
move WORK-05-X(4:1) to WORK-05-X(5:1)
move WORK-05-X(3:1) to WORK-05-X(4:1)
move WORK-05-X(2:1) to WORK-05-X(3:1)
move WORK-05-X(1:1) to WORK-05-X(2:1)
move "0" to WORK-05-X(1:1)
end-perform
end-if
exit.
*****************************************************************
* I/O Routines for the Control File... *
*****************************************************************
SYSUT3-CLOSE.
add 8 to ZERO giving APPL-RESULT.
close SYSUT3-FILE
if SYSUT3-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 SYSUT3' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT3-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
exit.
*---------------------------------------------------------------*
SYSUT3-READ.
read SYSUT3-FILE
if SYSUT3-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
add 1 to SYSUT3-RDR
else
if SYSUT3-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 SYSUT3-EOF
else
move 'READ Failure with SYSUT3' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT3-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
end-if
exit.
*---------------------------------------------------------------*
SYSUT3-OPEN.
add 8 to ZERO giving APPL-RESULT.
open input SYSUT3-FILE
if SYSUT3-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
move 'O' to SYSUT3-OPEN-FLAG
else
add 12 to ZERO giving APPL-RESULT
end-if
if APPL-AOK
CONTINUE
else
move 'OPEN Failure with SYSUT3' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT3-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
exit.
*****************************************************************
* I/O Routines for the Primary File... *
*****************************************************************
SYSUT1-CLOSE.
add 8 to ZERO giving APPL-RESULT.
close SYSUT1-FILE
if SYSUT1-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 SYSUT1 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT1-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
exit.
*---------------------------------------------------------------*
SYSUT1-READ.
read SYSUT1-FILE
if SYSUT1-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
add 1 to SYSUT1-RDR
else
if SYSUT1-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 SYSUT1-EOF
else
move 'READ Failure with SYSUT1 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT1-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
end-if
exit.
*---------------------------------------------------------------*
SYSUT1-OPEN.
add 8 to ZERO giving APPL-RESULT.
open input SYSUT1-FILE
if SYSUT1-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
move 'O' to SYSUT1-OPEN-FLAG
else
add 12 to ZERO giving APPL-RESULT
end-if
if APPL-AOK
CONTINUE
else
move 'OPEN Failure with SYSUT1 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT1-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
exit.
*****************************************************************
* I/O Routines for the Secondary File... *
*****************************************************************
SYSUT2-READ.
read SYSUT2-FILE
if SYSUT2-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
add 1 to SYSUT2-RDR
else
if SYSUT2-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 SYSUT2-EOF
else
move 'READ Failure with SYSUT2 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT2-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
end-if
exit.
*---------------------------------------------------------------*
SYSUT2-OPEN.
add 8 to ZERO giving APPL-RESULT.
open input SYSUT2-FILE
if SYSUT2-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
move 'O' to SYSUT2-OPEN-FLAG
else
add 12 to ZERO giving APPL-RESULT
end-if
if APPL-AOK
CONTINUE
else
move 'OPEN Failure with SYSUT2 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT2-STATUS to IO-STATUS
perform Z-DISPLAY-IO-STATUS
perform Z-ABEND-PROGRAM
end-if
exit.
*---------------------------------------------------------------*
SYSUT2-CLOSE.
add 8 to ZERO giving APPL-RESULT.
close SYSUT2-FILE
if SYSUT2-STATUS = '00'
subtract APPL-RESULT from APPL-RESULT
move 'C' to SYSUT2-OPEN-FLAG
else
add 12 to ZERO giving APPL-RESULT
end-if
if APPL-AOK
CONTINUE
else
move 'CLOSE Failure with SYSUT2 ' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
move SYSUT2-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-TEXT
end-if
move 'PROGRAM-IS-ABENDING...' to MESSAGE-TEXT
perform Z-DISPLAY-MESSAGE-TEXT
add 12 to ZERO giving RETURN-CODE
STOP RUN.
*****************************************************************
Z-DETERMINE-ENVIRONMENT.
add 16833 to ASC-OR-EBC
if ASC-A = 'A'
move 'Compiled for an ASCII environment...'
to MESSAGE-TEXT
else
if EBC-A = 'A'
move 'Compiled for an EBCDIC environment...'
to MESSAGE-TEXT
else
move 'Compiled for an UNKNOWN environment...'
to MESSAGE-TEXT
end-if
end-if
perform Z-DISPLAY-MESSAGE-TEXT
exit.
*****************************************************************
* Display CONSOLE messages... *
*****************************************************************
Z-DISPLAY-MESSAGE-TEXT.
if MESSAGE-TEXT-2 = SPACES
display MESSAGE-BUFFER(1:79)
else
display MESSAGE-BUFFER
end-if
move all SPACES to MESSAGE-TEXT
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-TEXT
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-TEXT
end-if
exit.
*****************************************************************
Z-POST-COPYRIGHT.
display SIM-TITLE
display SIM-COPYRIGHT
exit.
*****************************************************************
* This program was generated by SimoZAPS *
* A product of SimoTime Enterprises *
* Our e-mail address is: helpdesk@simotime.com *
* Also, visit our Web Site at http://www.simotime.com *
* *
* Generation Date: 2006-02-15 Generation Time: 22:09:09:76 *
*****************************************************************
Start Windows explorer and perform the following steps.
From Windows Explorer perform the following steps.
| 1. | From the left pane select the c:\DataMig1\HTML directory. The generated HTML documents are stored in this directory. |
| 2. | From the right pane double-click on ItemCB01.HTM. When a file has an extension of ".HTM" the default for WIndows is to start the Internet Explorer program and display the contents of the file. |
To view a sample HTML document refer to the Sample HTML Document for the Record Layout of the Item File .
The purpose of this session is to describe how to view or edit the generated COBOL source code that will compare two data files. This session also describes how to view the generated HTML document.
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 SimoTime Home Page is the starting point to review all the information 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.
The SimoREC1 Utility Program has the capability of generating a callable COBOL program that will do the conversion of a data string between EBCDIC and ASCII. The generated COBOL source code or the conversion tables may be viewed or modified to meet unique requirements. The generated program may be called by an I/O program generated by SimoZAPS.
This item will provide a link to an ASCII or EBCDIC translation table. A column for decimal, hexadecimal and binary is also included.
This document provides a quick summary of the File Status Key for VSAM data sets and QSAM files.
Check out The VSAM - QSAM Connection for more examples of mainframe VSAM and QSAM accessing techniques and sample code.
The hexadecimal dump of the parameter-buffer uses the same technique as describe in another SimoTime example that describes the dumping of a data string using COBOL. The name of the member that does the actual hexadecimal dump is called SimoDUMP. A copy file (PASSDUMP.CPY) is provided for defining the pass area.
You may view the complete list of examples at http://www.simotime.com/sim4dzip.htm and many are available as a SimoTime Z-Pack (a zip file package with sample source code, data and documentation).
Note: You must be attached to the Internet to download a Z-Pack or view the list.
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 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. 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-2010 SimoTime Enterprises All Rights Reserved |
| When technology complements business |
| http://www.simotime.com |