COMPARE prints information to LYNE and TOT.
The output to TOT is as follows:
-
A description of the two files being compared, which includes the MAXRECORDSIZE, BLOCKSIZE, UNITS, INTMODE, and CREATIONDATE file attribute values. If either of the files is not available, the program prints an error message.
-
If the files have different record sizes, the program does not perform a comparison, but prints an error message.
-
If you are comparing disk files and record counts differ, the program issues a warning message before starting the comparison.
-
The program lists the maximum number of errors that you specified.
-
If you specified sequence information in the COMPARE input, the program prints the information. If you did not specify sequence information, the program prints a message stating that it assumed unsequenced files were used.
-
If the program terminates the file comparison because it has reached the maximum number of errors, it prints a message along with the current record number of each file being compared.
-
If an end-of-file (EOF) condition occurs in one file before the other, the program prints a message. The message indicates in which file the end-of-file (EOF) condition occurred.
-
The program lists the number of differences.
-
The program lists the number of records in each file.
The output for LYNE is the same as for TOT except that if any differences occur, the program prints a list of those differences.
In the EOF condition described above, the utility assumes that records remaining in the other file are errors. They will be read and printed in LYNE until EOF or the maximum error count is exceeded.
Example 1
This example WFL job initiates COMPARE on five pairs of files. It contains instructions for the following actions:
-
The utility is to compare PROGRAM/ONE and PROGRAM/TWO record by record until it has made 5 unsuccessful comparisons.
-
The utility is to compare PROGRAM/THREE and PROGRAM/FOUR until it has made 5 unsuccessful comparisons. The sequence information for these two files begins in column 73 for a length of 8.
-
The utility is to compare PROGRAM/FIVE and PROGRAM/SIX record by record until it has made 25 unsuccessful comparisons.
-
The utility is to compare PROGRAM/SEVEN and PROGRAM/EIGHT until it makes 4 unsuccessful comparisons. The sequence information for these two files begins in column 1 for a length of 6.
-
The utility is to compare PROGRAM/NINE and PROGRAM/TEN until it makes 4 unsuccessful comparisons. The sequence information for these two files begins in column 1 for a length of 6.
BEGIN JOB; RUN SYSTEM/COMPARE; DATA PROGRAM/ONE. PROGRAM/TWO. PROGRAM/THREE. PROGRAM/FOUR. 73-8 PROGRAM/FIVE. PROGRAM/SIX. 25 PROGRAM/SEVEN. PROGRAM/EIGHT. 1-6 4 PROGRAM/NINE. PROGRAM/TEN. 4 1-6 END JOB
Example 2
This example shows both input and output for a COMPARE job.
Input
?BEGIN JOB; RUN SYSTEM/COMPARE; DATA FILE/A. FILE/B. 73-8 MYFILE/1. MYFILE/2. ?END JOB
Output from TOT
TOTAL FOR ALL FILES COMPARED ---------------------------------------------------- FILE 1 = FILE/A ON DISK. MAXRECORDSIZE = 15 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 FILE 2 = FILE/B ON DISK. MAXRECORDSIZE = 15 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 ----MAXIMUM ERROR DEFAULT = 5 ----SEQUENCED FILES, BEGINNING IN COL. 73 FOR A LENGTH OF 8 NUMBER OF DIFFERENCES = 3 NUMBER OF RECORDS IN FILE 1 = 27 NUMBER OF RECORDS IN FILE 2 = 27
FILE 1 = MYFILE/1 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 FILE 2 = MYFILE/2 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Wed, Jul 24, 1985 ---MAXIMUM ERROR DEFAULT = 5--- ---UNSEQUENCED FILES ASSUMED--- NUMBER OF DIFFERENCES = 1 NUMBER OF RECORDS IN FILE 1 = 2 NUMBER OF RECORDS IN FILE 2 = 2
Output from LYNE
FILE 1 = FILE/A ON DISK. MAXRECORDSIZE = 15 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 FILE 2 = FILE/B ON DISK. MAXRECORDSIZE = 15 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 ----MAXIMUM ERROR DEFAULT = 5 ----SEQUENCED FILES, BEGINNING IN COL. 73 FOR A LENGTH OF 8 *** LISTING OF DIFFERENCES *** X := COUNTER - 1; 00001500 (ACCTDOC)FILE/A ON ACCOUNT. Y := COUNTER -1; 00001500 (ACCTDOC)FILE/B ON ACCOUNT. COUNTER := * + 2; 00004000 (ACCTDOC)FILE/A ON ACCOUNT. COUNTER := * + 1; 00004000 (ACCTDOC)FILE/B ON ACCOUNT. TOTAL := COUNTER; 00010000 (ACCTDOC)FILE/A ON ACCOUNT. TOTAL := * + COUNTER; 00010000 (ACCTDOC)FILE/A ON ACCOUNT. NUMBER OF DIFFERENCES = 3 NUMBER OF RECORDS IN FILE 1 = 27 NUMBER OF RECORDS IN FILE 2 = 27
FILE 1 = MYFILE/1 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Tues, Sept 7, 1993 FILE 2 = MYFILE/2 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Wed, Jul 24, 1985 ---MAXIMUM ERROR DEFAULT = 5--- ---UNSEQUENCED FILES ASSUMED--- *** LISTING OF DIFFERENCES *** ********* THE FILES DIFFER IN RECORD NUMBER 2 NUMBER OF DIFFERENCES = 1 NUMBER OF RECORDS IN FILE 1 = 2 NUMBER OF RECORDS IN FILE 2 = 2
Example 3
This example is a WFL job initiating a COMPARE of two Cobol74 files, F/1 and F/2. F/2 contains two appended records and its second record is in error.
Input
?BEGIN JOB; RUN SYSTEM/COMPARE; DATA F/1. F/2. 1-6 ?END JOB.
F/1 F/2 IDENTIFICATION DIVISION. IDENTIFICATION DIVISION. PROGRAM-ID. CREATE1. PROGRAMID. CREATE1. ENVIRONMENT DIVISION. ENVIRONMENT DIVISION. FILE-CONTROL. FILE-CONTROL. DATA DIVISION. DATA DIVISION. FILE SECTION. FILE SECTION. WORKING-STORAGE SECTION. WORKING-STORAGE SECTION. PROCEDURE DIVISION. PROCEDURE DIVISION. * BLANK RECORD *. * BLANK RECORD *.
Output (LYNE only)
---------------------------------------------------- FILE 1 = F/1 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Wed, Aug 6, 1997
FILE 2 = F/2 ON DISK. MAXRECORDSIZE = 14 BLOCKSIZE = 420 UNITS = WORDS INTMODE = EBCDIC CREATION DATE = Wed, Aug 6, 1997
----MAXIMUM ERROR DEFAULT = 5 ----SEQUENCED FILES, BEGINNING IN COL. 1 FOR A LENGTH OF 6
**** WARNING - RECORD COUNTS DIFFER -- COMPARE ATTEMPTED ****
**** LISTING OF DIFFERENCES ****
000020 PROGRAM-ID. CREATE1. ... (USR)F/1 ON PACK 000020 PROGRAMID. CREATE1. ... (USR)F/2 ON PACK
****EOF ERROR IN FILE 1 **** LISTING OF FILE 2 ADDITIONAL RECORDS ****
000090 * BLANK RECORD * ... (USR)F/2 ON PACK
000100 * BLANK RECORD * ... (USR)F/2 ON PACK
NUMBER OF DIFFERENCES = 3 NUMBER OF RECORDS IN FILE 1 = 8 NUMBER OF RECORDS IN FILE 2 = 10
Example 4
This example shows how to run SYSTEM/COMPARE from CANDE for files with long file names.
RUN *SYSTEM/COMPARE; FILE FILE3(TITLE=COMPARE/LONGNAME,KIND=DISK)
where COMPARE/LONGNAME is a DATA file containing:
DATA/CP/LT1/WWWROOT/RFC/"HOW TO CONFIGURE A FIREWALL & FOR DOMAINS AND TRUSTS (Q179442)_FILES"/"CURVE.GIF". DATA/CP/TEST. 7 1-8 DATA/CP/"THISISALONGFILENAMEWITHA ; . ". DATA/CP/"THISISALONGFILENAMEWITH2;;. ". 7 1-8
This will compare the file DATA/CP/LT1/WWWROOT/RFC/"HOW TO CONFIGURE A FIREWALL FOR DOMAINS AND TRUSTS (Q179442)_FILES"/"CURVE.GIF" with the file DATA/CP/TEST, and the file DATA/CP/"THISISALONGFILENAMEWITHA ; . " with the file DATA/CP/"THISISALONGFILENAMEWITH2;;. ".