Comparing Files
Accessing Files
4–12 107365 Tandem Computers Incorporated
Comparing Files Use the routine in Figure 4-6, fcomp, to perform a line-for-line comparison of two
files. A mismatch does not resynchronize the two files.
Fcomp reads a record from each of the two files and then calls #COMPAREV to
compare the records. The maximum line length for an edit file is 239 bytes; fcomp
uses this value as a maximum line length for the input records.
Fcomp supports two options: you can limit the comparison to a range of columns
within the files, and you can write the results to a file.
Fcomp calls the getargs macro (from Section 3, “Developing TACL Routines”) and
the defaultvars macro (from Section 2, “Developing TACL Programs”):
Getargs parses the arguments of a calling routine; it accepts sets of three
arguments:
REQUIRED or OPTIONAL specify whether an argument must be present or
can be omitted from the list of arguments.
Type specifies an #ARGUMENT alternative, such as FILENAME or
KEYWORD.
Variable is pushed and set by the TEXT option of #ARGUMENT if the
argument is supplied; otherwise, the variable remains empty.
defaultvars accepts a space-separated list of space-separated pairs (variable
levels and values) and sets each empty variable level to its corresponding value.
For each pair of arguments:
Variable-level
specifies the name of a variable level.
Value
specifies the corresponding value, or can be empty. Value cannot
contain any spaces.
To call fcomp , load the associated file and enter:
fcomp
file1
,
file2
[, [
f1
] [, [
f2
] [, [
result
]]]]
where
file1
is the name of one of the comparison files.
file2
is the name of the other comparison file.
f1
is a starting field range (optional).