1 MODIFY
!
	$  MODIFY  file(s),...  "string1"  "string2"

	$  MODIFY  file(s),...  "string1"  /DELETE (or /KEEP)

	$  MODIFY  file(s)  /INPUT

Performs string replacement in lines of the specified file(s), or deletes
all lines in the specified file(s) containing the given string.

A list of files, including wildcard file names, may be used.  The output
file(s) are the next higher version(s) of the input file(s).  Output files
are not created unless modifications were made.

The /INPUT qualifier allows a group of string replacements to be performed
on each file.
!
2 Parameters
!
	$  MODIFY  file(s),...  "string1"  "string2"
!
3 Files
!
	file(s) , ...

The first parameter to MODIFY is the names of the files to be modified.
A list of files, separated by commas, may be used; wildcard file specifi-
cations are allowed.

If wildcards are used, MODIFY will automatically ignore the following
types of files:

	.EXE	.OBJ	.OLB	.HLB	.DIR	.JOU	.TJL

MODIFY will always ignore files which are not sequential with variable-
length or VFC records.
!
3 string1
!
The second parameter to MODIFY is the string to be searched for in the
input file(s).  If this string contains lowercase characters, blanks, or
special characters, it must be enclosed in quotation marks (").

See also the descriptions of the qualifiers /CTRL, /EXACT, and /UNIT.

The qualifiers /COLUMNS and /SELECT affect whether occurrences of
"string1" are considered for replacement.

This parameter must NOT be used if the /INPUT qualifier is used.
!
3 string2
!
The third parameter to MODIFY is the string to replace "string1".  If
this string contains lowercase characters, blanks, or special characters,
it must be enclosed in quotation marks (").

This parameter must NOT be used if the /DELETE, /KEEP, or /INPUT qualifier
is used.

See also the descriptions of the qualifiers /CTRL and /LINE.
!
2 Command_Qualifiers
/CONFIRM

When /CONFIRM is used, each line with a potential change is displayed
and the user can respond with one of the following characters:

  Y - Make this change and continue.
  N - Do not make this change; continue (this is the default).
  C - Make this change, cancel /CONFIRM (continue without stopping).
  E - Make this change, let caller edit the line (see below)
  L - Do not make this change; go to the next line.
  F - Do not make this change; copy the rest of this file verbatim, then
       continue normally with the next file.
  Q - Do not make this change; quit immediately.  The current file will
       not be modified.
  ? - Display a brief description of the possible responses.

This qualifier can only be used when both SYS$INPUT and SYS$OUTPUT are
directed to an interactive terminal.

The E option will make the change on the line, then display the line and
let you use DCL line editing on it.  This requires a VT-compatible term-
inal.  If your terminal is set to 80 columns, and the line is longer,
MODIFY will offer to set your terminal to 132 columns.

You can use the left and right arrows to move the cursor, except you
cannot move the cursor to a previous line unless the cursor is at the
end of the data.  The following keys are also useful:

    Ctrl/R -- Refresh the screen (useful after MAIL notification)
    Ctrl/A -- Toggle between insert and overstrike modes
    Ctrl/E -- Go to the end of the (screen) line
        BS -- To to the beginning of the (screen) line
        LF -- Delete the word to the left of the cursor
    Ctrl/U -- Delete everything to the left of the cursor

/DELETE

When /DELETE is used, all lines containing "string1" are deleted, and
will not appear in the output file.

When /DELETE is used, the following must not be specified:

	- The third parameter to MODIFY ( "string2" )
	- The /INPUT qualifier
	- The /KEEP qualfier
	- The /LINE qualifier

/KEEP

This qualifier is the opposite of /DELETE; all lines containing "string1"
are kept, and all other lines are deleted.

When /KEEP is used, the following must not be specified:

	- The third parameter to MODIFY ( "string2" )
	- The /DELETE qualfier
	- The /INPUT qualifier
	- The /LINE qualifier

/INPUT

When /INPUT is used, MODIFY reads input directives from the the file
SYS$INPUT.  If MODIFY is being run interactively, and SYS$INPUT is the
terminal keyboard, then MODIFY displays the prompt "MODIFY> " for
directives to be entered; a CTRL\Z or EXIT directive terminates reading
of directives.

IMPORTANT-- When /INPUT is used, the MODIFY command line cannot contain
            a list of file names; the single allowed file specification
            can, however, contain wildcards.

The directives must be in one of the following formats:

	MODIFY  "string1"  "string2"  [qualifiers...]

	DELETE  "string1"  [qualifiers...]

	KEEP "string1"  [qualifiers...]

	EXIT

 Where "qualifiers" can be any of the "editing qualifiers": /CTRL,
 /COLUMNS, /EXACT, /LINE, /SELECT, or /UNIT.  (DELETE and KEEP cannot
 use /LINE.)  Any qualifiers specified remain in effect only for the
 directive on which they appear.

 These editing qualifiers must not appear on the MODIFY command line when
 /INPUT is used.  The "command qualifers" /CONFIRM, /DELETE, /KEEP, /INPUT,
 /LOG, /OUTPUT, /SYMBOL, and /VERSION can only be used on the MODIFY com-
 mand line, and not on directives.

The syntax rules, and the definitions of the parameters and qualifiers,
are the same as for the MODIFY command line.  Comments (beginning with "!")
may appear on directives after the strings and qualifiers.

The MODIFY operation changes all occurrences of "string1" in the specified
file(s) to "string2".  The DELETE operation deletes all lines in the speci-
fied file(s) which contain "string1".  The KEEP operation deletes all lines
which do NOT contain "string1".  The EXIT directive indicates the end of
the input; any directives after EXIT will be ignored.

First MODIFY reads in and stores all the directives.  Then, it applies the
first directive to the entire first (or only) file, then the second direc-
tive to the entire first file, etc.  After all directives have been applied
to the first file, the remaining files (if any) are processed in the same
manner.

Example:	$! CHANGE.COM, changes Fortran sources
		$!
		$  MODIFY *.FOR /INPUT
		MODIFY "COMMON /X/" "COMMON /XYZ/"
		DELETE "IMPLICIT" /UNIT /COL=7
		$!

/LOG

    /LOG
    /LOG=ALL

If just /LOG is specified, each file examined and the number of modifica-
tions to it is displayed.  A summary line shows the total number of changes,
changed files, and total files examined.

If /LOG=ALL is used, then in addition each line number where a change was
made is displayed.

/OUTPUT

    /OUTPUT=output_file_name

When MODIFY is used on a single file (not a list of file names, or a wild-
card file specification), then this qualifier can be used to specify the
name of the output file.

When /OUTPUT is used, the output file is created even if no modifications
are made.  When /OUTPUT is not used, no output files are created for files
which contain no matches to "string1".

/SYMBOL

    /SYMBOL[=symbol_name]

When /SYMBOL is used, then when MODIFY has processed all the input files,
it will create a Local DCL symbol with the given name.  The symbol will
contain a count of the number of changes made.  The symbol will be a string
symbol containing a decimal integer.  If /SYMBOL is specified with no symbol
name, then the name MODIFY_CHANGES is used.

Note that if /DELETE or /KEEP is used (or the DELETE or KEEP directive is
used with /INPUT), and a line contains more than one occurrence of "string1",
this will count as only one change.

/VERSION

If /VERSION is used, MODIFY will display its current version number and
creation date.  No other parameters or qualifiers can be supplied on the
command line when /VERSION is used.

2 Editing_Qualifiers
/CTRL

The parameter strings, and the /SELECT string, may specify control char-
acters.  If /CTRL is specified, then all occurrences of carets ("^") in
the strings are assumed to be part of a control character specification.

For example "^A" specifies a Control/A.  The string "^^" is used to
specify an actual caret.  Besides ^A through ^Z, the following codes
are defined:

  ^2 - NUL        ^3 - ESC        ^4 - FS        ^5 - GS

  ^6 - RS         ^7 - US         ^8 - DEL

/COLUMNS

    /COLUMNS=i-j    or    /COLUMNS=i:j    or    /COLUMNS=(i,j)

Specifies a range of columns in which "string1" must BEGIN in order to
be considered for replacement.  On lines which contain tab characters,
the standard DEC eight-column tab settings are assumed when counting
columns.  If the string must begin in a definite single column, then

    /COLUMN=i

may be specified.

/EXACT

When /EXACT is used, "string1" must match EXACTLY, i.e. lowercase
letters in "string1" must match lowercase letters in the file, and
uppercase letters in "string1" must match uppercase letters in the
file.  The default is /NOEXACT, which means that case of alphabetic
characters is not considered.

Note that "string1" must be surrounded by quotation marks on the
command line, or DCL will translate it to uppercase.

/LINE

When /LINE is used, every line which contains a match to "string1"
is ENTIRELY replaced with "string2".  The default is /NOLINE; just
the text of "string1" is replaced with "string2".  For example:

File A.B:    This is a line

Command 1:   $ MODIFY A.B "This" "That"

Output 1:    That is a line

Command 2:   $ MODIFY A.B "This" "That" /LINE

Output 2:    That

/SELECT

    /SELECT="string3"

When /SELECT is used, then only lines containing "string3" are checked for
replacements.  That is, if a line contains both "string1" and "string3", 
then "string1" is replaced with "string2".

Note that no order is assumed; "string3" can appear before, after, or
overlapped with "string1" on data lines and still be found.

The /CTRL and /EXACT qualifiers operate on "string3" as well as "string1"
and "string2".  The /UNIT qualifier does NOT operate on "string3".

If "string3" contains lowercase characters, blanks, or special characters,
it must be enclosed in quotation marks (").

/UNIT

When /UNIT is used, matches to "string1" will be ignored unless they are
immediately surrounded by delimiters or the beginning or end of the line.
For example, when searching for "MMM", the line "KLMMMNO" will normally
match, but will not match when /UNIT is used.  The line "KL+MMM-NO" will
still match.

All characters except numerals, alphabetics, "$" and "_" are considered
to be delimiters.  All multinational characters which are not alphabetic
are considered delimiters; mu and the masculine and feminine ordinals are
considered alphabetic.

