Use the following WFL job to initiate the SYSTEM/COMPARE utility. You must place a question mark (?) in column 1 of the first line after the inclusion of the compare commands so that the WFL compiler knows that it has reached the end of the compare command records.
BEGIN JOB; RUN SYSTEM/COMPARE; DATA <compare command> <compare command> . . ? END JOB;
<compare command>
──<file name 1>── . ──<file name 2>── . ───────────────────────────────► ►─┬───────────────────────────────────────────────────────────┬────────┤ │ ┌◄──────────────────────────────────────────────────────┐ │ └─┴─┬─/1\─<maximum errors>──────────────────────────────┬─┴─┘ └─/1\─<sequence number column>── - ──<field length>─┘
Explanation
<file name 1>.
<file name 2>.
Specifies the names of the files to be compared. The file names are terminated by a period and a space (. ). If either file name is too long to be entered on a single line, it can be split across multiple lines. An unquoted file name can be split at a node boundary (after a "/" symbol). A file name containing a quoted node can be split prior to any non-space character by placing an ampersand (&) concatenation symbol as the last non-space character on the line. For example the file name
DATA/COMPARE/DEMONSTRATE/"HOW TO SPLIT A FILE NAME"
can be split as
DATA/COMPARE/DEMONSTRATE/ "HOW TO SPLIT A FILE NAME"
or as
DATA/COMPARE/DEMONSTRATE/"HOW TO & SPLIT A FILE NAME"
The system assumes that the files are disk files. If the files are not disk files, you must label-equate each one. You can compare EBCDIC, ASCII, and HEX disk files.
<maximum errors>
Specifies the number of unsuccessful comparisons that are to be made before COMPARE is to proceed to the next pair of files. The default value for the maximum errors field is 5.
<sequence number column> –<field length>
Specifies the column in which the sequence numbers of the files are to begin and the field length of the sequence numbers.
If you do not specify sequence information about the files in the COMPARE input, the utility compares the files record by record.
The program reads a new record from each file for each comparison and behaves in the following manner:
-
If a difference occurs, the program prints the record number at which the difference occurred.
When you specify record sequence information for the files in your COMPARE input and a difference occurs, the program behaves this way:
-
If sequence numbers agree but the records do not agree, the program prints the contents of both records.
If the record sequence number of the record read from the first file is greater than the record sequence number of the record read from the second file, the program prints the record from the second file and compares the next record from the second file against the first record from the first file, and vice versa.