HELP DIFFERENCES — VMS 4.6
Compares the contents of two disk files and creates a listing of
those records that do not match.
Format:
DIFFERENCES master-file-spec [revision-file-spec]
Additional information available:
ParametersCommand QualifiersExamples
Parameters
master-file-spec Specifies the name of the primary input file to be compared. The file specification must include a file name and a file type. No wildcard characters are allowed in the file specification. revision-file-spec Specifies the name of the secondary input file to be compared. Any nonspecified fields default to the corresponding fields of the primary input file specification. If you do not specify a secondary input file, the DIFFERENCES command uses the next lower version of the primary input file. No wildcard characters are allowed in the file specification.
Command Qualifiers
Additional information available:
/CHANGE_BAR/COMMENT_DELIMITER/IGNORE/MATCH
/MAXIMUM_DIFFERENCES/MERGED/MODE/NUMBER/OUTPUT
/PARALLEL/SEPARATED/SLP/WIDTH/WINDOW
/CHANGE_BAR
/CHANGE_BAR[=(format[,...])] Requests that the output contain a listing of the associated files with a change bar character next to the lines that do not match. You can specify any of the following format keywords: c A change bar character. NUMBER Include line numbers. NONUMBER Do not include line numbers. In ASCII output mode, the change bar character parameter specifies a one-character code that will appear in the left margin next to records that do not have a match. By default, an exclamation point is used as the change bar character. In HEXADECIMAL and OCTAL output mode, the change bar character is ignored. Instead, the string "***CHANGE***" appears in the record header. You can control whether the change bar listing includes line numbers by specifying either NUMBER or NONUMBER. If neither is specified, the default is controlled by the /[NO]NUMBER command qualifier. To specify both a change bar character and either NUMBER or NONUMBER, separate the options with a comma and enclose the list in parentheses, for example, /CHANGE_BAR=($,NUMBER).
/COMMENT_DELIMITER
/COMMENT_DELIMITER[=(delimiter[,...])]
Specifies one or more comment delimiters. This qualifier is used
with or without the /IGNORE=COMMENTS qualifier to indicate which
comments are to be ignored.
You can specify a comment delimiter either by listing the character
itself or by using one of the following keywords:
Keyword Character
COLON Colon (:)
COMMA Comma (,)
EXCLAMATION Exclamation point (!)
FORM_FEED Form feed
LEFT Left bracket ([)
RIGHT Right bracket (])
SEMI_COLON Semicolon (;)
SLASH Slash (/)
SPACE Space
TAB Horizontal tab
You can specify up to 32 comment characters. If you specify only
one delimiter, you can omit the parentheses.
When you specify a keyword, you must type at least the first two
letters of the keyword, since single letters are treated as
delimiters. Lowercase letters are automatically changed to
uppercase unless they are enclosed in quotation marks. If both the
uppercase and lowercase forms of a letter are to be used as
delimiters, the letter must be specified twice, once in uppercase
and once in lowercase. Non-alphanumeric characters (for example,
"!" and ",") must be enclosed in quotation marks.
If you do not include either a comment character or a keyword with
the /COMMAND_DELIMITER qualifier, DIFFERENCES assumes a default
comment character based on the file type. For some file types (COB
and FOR), the default comment characters are considered valid
delimiters only if they appear in the first column of a line.
Multicharacter comment delimiters are not allowed.
/IGNORE
/IGNORE=(option[,...])
Specifies that one or more special characters, strings, or records be
ignored during the comparison. The /IGNORE qualifier also controls
whether the comparison records are output to the listing file
exactly as they appeared in the input file or as edited records.
The option parameter refers either to a character or a keyword. The
following keywords are valid options for the /IGNORE qualifier:
BLANK_LINES Blank lines between data lines.
COMMENTS Data that follow a comment delimiter. (Use the
/COMMENT_DELIMITER qualifier to designate one or
more non-default comment delimiters.)
FORM_FEEDS Form feed characters.
HEADER[=n] First n records beginning with a record whose
first character is a form feed. (The first
record is not ignored if the only character it
contains is a form feed.) The default value of n
is 2.
TRAILING_SPACES Space and tab characters at the end of a line of
data.
SPACING Multiple spaces or tabs within lines of data.
(Each set of contiguous spaces or tabs is
replaced by a single space.)
Each data line is checked for COMMENTS, FORM_FEEDS, HEADER, and
SPACING before it is tested for TRAILING_SPACES and then
BLANK_LINES. Therefore, if you direct DIFFERENCES to ignore
COMMENTS, TRAILING_SPACES, and BLANK_LINES, it will totally ignore a
record that contains several spaces or blank lines followed by a
comment.
By default, the DIFFERENCES command compares every character in each
file and reports all differences. Also, by default, DIFFERENCES
lists records in the output file with all ignored characters
deleted.
Although output records can contain any characters that appear in
the input files, you can choose to have output records formatted as
follows:
Character Formatted Output
Tab (CTRL/I) 1-8 spaces
RET (CTRL/M) <CR>
Line feed (CTRL/J) <LF>
Vertical tab (CTRL/K) <VT>
Form feed (CTRL/L) <FF>
Other nonprinting characters . (period)
If you specify /PARALLEL, output formatting is always performed.
You can choose how you want the records to appear by specifying one
of the following keywords with the /IGNORE qualifier:
EDITED Output records are listed with ignored strings
deleted.
EXACT Output records are listed exactly as they appear
in the input file.
PRETTY Output records are formatted.
/MATCH
/MATCH=size Specifies the number of records that constitutes a match. By default, after DIFFERENCES finds unmatched records, it assumes that the files once again match after it finds three sequential records that match. Use the /MATCH qualifier to override the default match size of 3. You can increase the /MATCH value if you feel that DIFFERENCES is incorrectly matching sections of the master and revision input files after it has detected a difference.
/MAXIMUM_DIFFERENCES
/MAXIMUM_DIFFERENCES=n Specifies that DIFFERENCES is to terminate after a specified number of unmatched records has been found. The number of unmatched records is determined by finding the maximum number of difference records for each difference section and adding them together. If DIFFERENCES reaches the maximum number of differences that you specify, it will output only those records that were detected before the maximum was reached. Also, it will output, at most, one listing format and return a warning message. By default, there is no maximum number of differences. All records in the specified input files are compared.
/MERGED
/MERGED[=n] Requests that the output file contain a merged list of differences. The value n indicates the number of matched records to list after each list of unmatched records; it should be a decimal number less than or equal to the size of a match (see the /MATCH=size qualifier). By default, DIFFERENCES produces a merged listing with one matched record listed after each set of unmatched records (that is, /MERGED=1). Use the /MERGED qualifier to override the default value of n, or to include a merged listing with other types of output.
/MODE
/MODE=(radix[,...])
Specifies the format of the output listing. You can request that the
output be formatted in one or more radix modes by specifying the
following keywords:
ASCII
HEXADECIMAL
OCTAL
Enclose the keywords in parentheses. You can truncate any of these
keywords to one or more characters.
By default, DIFFERENCES writes the output file in ASCII. If you
specify more than one radix, the output listing contains the file
comparison in each specified radix. When you specify two or more
radix modes, separate them with commas.
If you specify the /PARALLEL or /SLP qualifier, the /MODE qualifier
is ignored for that listing form.
/NUMBER
/NUMBER (default) /NONUMBER Controls whether line numbers are to be generated for records in the listing.
/OUTPUT
/OUTPUT[=file-spec] Defines an output file to receive the output difference list. If you omit the /OUTPUT qualifier, the output is written to the current SYS$OUTPUT device. If you use the /OUTPUT qualifier without a file specification, the output is directed to a file with the same name as the master file with the file type DIF. When you specify /OUTPUT, you can control the defaults applied to the output file specification as described in Section 2.4 of the VAX/VMS DCL Concepts Manual. The default output file type is DIF. No wildcard characters are allowed in the file specification.
/PARALLEL
/PARALLEL[=n] Requests that the output file contain a parallel list of differences. The value n indicates the number of matched records to output after each list of unmatched records; it should be a decimal number less than or equal to the size of the match (see the /MATCH=size qualifier). By default, DIFFERENCES does not list records after each list of unmatched records. Also by default, DIFFERENCES creates only a list of merged differences.
/SEPARATED
/SEPARATED[=(input-file[,...])]
Requests that the output file contain sequential lists of unmatched
records from the specified input files. You can designate the
desired input files by specifying the following keywords:
MASTER
REVISION
If you specify only one input file, you can omit the parentheses.
If you specify the /SEPARATED qualifier without designating any
input files, DIFFERENCES will generate a separate listing for each
input file.
By default, DIFFERENCES creates only a merged list of differences.
/SLP
/SLP Requests that DIFFERENCES produce an output file suitable for input to the SLP editor. If you use the /SLP qualifier, you cannot specify any of the following output file qualifiers: /MERGED, /PARALLEL, /SEPARATED, or /CHANGE_BAR. Use the output file produced by the SLP qualifier as input to SLP to update the master input file, that is, to make the master input file match the revision input file. When you specify /SLP and you do not specify /OUTPUT, DIFFERENCES writes the output file to a file with the same file name as the master input file with the file type DIF.
/WIDTH
/WIDTH=n Specifies the width of lines in the output listing. By default, output is 132 characters wide, unless output is directed to the terminal. In that case, the output line width is controlled by the terminal line width. Use the SET TERMINAL command to change the terminal line width.
/WINDOW
/WINDOW=size Controls the number of records to search before listing a record as unmatched and continuing with the next record in the master input file. The window size is the minimum size of a differences section that will cause DIFFERENCES to lose synchronization between the two input files. By default, DIFFERENCES searches to the ends of both input files before listing a record as unmatched.
Examples
1. $ DIFFERENCES EXAMPLE.TXT
************
File DISK1:[GEORGE.TEXT]EXAMPLE.TXT;2
1 DEMONSTRATION
2 OF V3.0 DIFFERENCES
3 UTILITY
******
File DISK1:[GEORGE.TEXT]EXAMPLE.TXT;1
1 DEMONSTRATION
2 OF VMS DIFFERENCES
3 UTILITY
************
Number of difference sections found: 1
Number of difference records found: 2
DIFFERENCES/MERGED=1-
DISK1:[GEORGE.TEXT]EXAMPLE.TXT;2
DISK1:[GEORGE.TEXT]EXAMPLE.TXT;1
The DIFFERENCES command compares the contents of the two most recent
versions of the file EXAMPLE.TXT in the current default directory.
DIFFERENCES compares every character in every record and displays
the results at the terminal.