Skip to main content

About Search and Replace Dialog

	Caution! This dialog does search and replace on the selected directory files only. The sub-directories are not searched.

    The Browse button next to Search Directory box, if it exists, allows you to browse for directories on your PC.
    If the 'Browse' button next to Search Directory box does not exist exist, the supplied directory is used.
    The directory name cannot be changed when the text box is displayed in gray.   

    Use Select File(s) box to select one or more files of interest. File names are not 
    case sensitive. The wild card choices are in the drop-down list.

    Use Search String box to provide the search string. 
    The drop-down list contains history of strings used in the past.
    When Hex Search button is checked, the string must contain a valid hex string (characters 0-f).

    Use Replace With box to provide the replace string. 
    The drop-down list contains history of strings used in the past.
    When Hex Replace button is checked, the string must contain a valid hex string (characters 0-f).

    Check Case Sensitive button to make search characters case sensitive. 
    Un-check Case Sensitive button to make search case insensitive. 

    The Search and Replace button accepts your entries and presents a list of files for further filtering.

    The Cancel button exists without any action.

    Be careful, doing Search and Replace using wild card may impact multiple files.

Additional Links

For life cycle of Undo Search and Replace and Redo Search and Replace capabilities, see the Manage Archive Retain Option document.

Special File Types

Program source of mainframe files require a special attention because the files are of fixed record length and continuation rules must be observed as follows:

       Easytrieve Plus programs
       (file type .ezt, .ezx and .cpy)
          Record length = 80
          Statements start = column 1
          Statements end = column 72
          Lines are continued with '-'
          Additional line text starts in column 1 
          Search and Replace area = column 1 - 72
       
       Business Assembly Language and Assembler Macros 
       (file type .bal and .mac)   
          Record length = 80
          Statements start = column 1
          Statements end = column 71
          Lines are continued with an 'X' in column 72
          Additional line text starts in column 2 followed by the additional text
          Search and Replace area = column 1 - 72
          
       JCL files
       (file type .jcl)    
          Record length = 80
          Statements start = column 1
          Statements end = column 71
          Lines are continued with an 'X' in Column 72
          Additional line text starts in column 1 with '// ' followed by the additional text
         Search and Replace area = column 1 - 72
       
       COBOL Programs
       (file type .cob)    
          Record length = 80
          Sequence numbers start = column 1 - 6.
          Comment or continuation flag = column 7 
          Area A start = column 8 - 11
          Area B start = column 12 - 72
          Lines are continued with an 'X' in Column 7
          Additional line text starts in column 1 with '// ' followed by the additional text
         Search and Replace area = 1 - 72
    

String Replacement Rules

Each file in the selected list is searched line by line. Strings in the record that match the search string are replaced by the replace string. All occurrences are replaced.

When replace string length is equal to the search string, the text is replaced as is.

When replace string length is shorter than the search string, the text is shifted to the left.

When replace string length is longer than the search string, the text is shifted to the right only if not enough spaces are available to compensate for the length difference.

All spaces are considered, even those after the subsequent words until enough spaces are located to compensate for the length difference.

This logic is employed to reduce the impact on the line length.

When newly created string length exceeds the line length limit, the string is split into two lines according to the file continuation rules as described in the Special File Types paragraph above.

*********************** end of document ************************