Controlling the Search
SWAP looks for a search string in the input files and substitutes a replacement string if one has been specified.  This chapter describes how to control the search.

Sequence of Operations
If you specify record truncation and/or TAB removal, the operations are done in the following order:

-     Remove TAB characters
-     Replace strings
-     Truncate record

Case
SWAP will take case (ie UPPERCASE or lowercase) into account or ignore it depending on the /EXACT qualifier.  If case is ignored (the default), the following strings: "TEST" and "test" would match the string "TEST" and be replaced.  If case is significant, only "TEST" would match and be replaced. When using the menu interface control case matching through the Modify Setup Menu.

The search string is the only parameter the /EXACT has any effect on.  The replacement string will always be substituted in as it appears.

Limiting the Search Area
SWAP allows you to limit the records within each file and the columns within each record that are searched. This allows you to leave portions of the file untouched even if they contain the search string.

Ignoring Records
Specify which records are to be searched by specifying a range using the /RANGE qualifier.  SWAP numbers the records in a file starting at 1 and incrementing by 1.  For example, if you specify /RANGE=(27,450), only records between 27 and 450 inclusive will be searched.  Records numbered 1_26 and 450 to the end of the file would be left unchanged. When using the menu interface control range through the Line Range item on the Modify Setup Menu.

NOTE:  If the /RANGE or /COLUMNS qualifiers are used, NO changes will be made outside of the specified borders.  This means that tabs and truncation will not be performed outside of these borders.

Ignoring Columns
Specify which columns are to be searched by specifying a set of columns using the /COLUMNS qualifier.  SWAP numbers the columns in a record starting at 1 and incrementing by 1.  For example, if you specify /COLUMNS=(7,72), only columns between 7 and 72 inclusive will be searched.  Columns 1_6 and 73 to the end of the record would be left unchanged. When using the menu control columns through the column range item on the modify setup menu.

Confirm
If you specify /CONFIRM, SWAP will ask you what you want to do each time it finds the search string. This allows you to control the replacement procedure more closely.  You have the following options:  

- Make the change
- Ignore the change but continue searching the record and file.
- Ignore this file but continue searching the remaining files.  The current file will remain unchanged and the search will continue with the next file.
- Abort the search and return to command level.  The current file will remain unchanged, SWAP will terminate and the DCL prompt will appear.
- Help
When using the menu control confirm through the confirm item on the modify setup menu.