Using the CHANGE command in the Find/Change Utility

The CHANGE command operates on the data set or data set members selected in the Find/Change Utility.

The CHANGE command or any of its abbreviations is entered on the Command line, together with the desired parameters. To find and replace long strings that do not fit on the Command line, enter the CHANGE primary command (or one of its abbreviations, such as C) with no parameters, or enter the CX command on the Command line with no parameters. This displays the Extended Command Entry panel, in which you can enter long strings and the CHANGE command parameters.

You can limit the effects of the change command by issuing the BOUNDS command before issuing the CHANGE command, or by using one or more of the following parameters:

col1 and col2
Col1 is the first column to be included in the range of columns to be searched. It must be greater than or equal to 1, and less than or equal to the maximum record length. Col2 specifies the last column to be included in the range of columns to be searched.
MAXINREC(n)
The MAXINREC(n) parameter allows you to specify the maximum number of changes that can be made within a single record.
MAXRECS(n)
The MAXRECS(n) parameter allows you to specify the maximum number of records that can be changed within a single data set or PDS member.
FIRST(n)
The FIRST(n) parameter allows you to specify the maximum number of total changes that can be performed within a single data set or PDS member.

Suppose you want to change the string “SALESPERSON-CODE” to “SALESPERSON-NUMB” in certain members of a PDS.

  1. Select the members you want to search.
  2. Enter CHANGE SALESPERSON-CODE SALESPERSON-NUMB. Z Data Tools displays a panel showing the changed records (only one in this case) as shown in Figure 1.
    Figure 1. Find/Change Utility: example of results from CHANGE command
       Menu  Utilities  Compilers  Help
    ────────────────────────────────────────────────────────────────────────────────
     BROWSE    HFMUSER.SRCHFOR.LIST                       Line 00000000 Col 001 080
    ********************************* Top of Data **********************************
    HCL Z Data Tools
    Find/Change Listing DSN:HFMUSER.FMOS390.COPY
    
     TRANREC2                    ---------- STRING(S) FOUND ----------
    Record Number
         18             05 salesperson-numb           Pic 9(4).
    
      -- Find/Change summary section --
      Records found: 1 Records processed: 33
      Members w/recs: 1 Members wo/recs: 0
      Search cols: 1:80 Longest line: 80
      Edit options in effect: CAPS:OFF
                     Count  Value
      Found   :          1  >SALESPERSON-CODE<
      Changed :          1  >SALESPERSON-numb<
     Command ===>                                                  Scroll ===> PAGE_
      F1=Help    F2=Split   F3=Exit    F5=Rfind   F7=Up      F8=Down    F9=Swap
     F10=Left   F11=Right  F12=Cancel
    Note: On the Find/Change Utility report, the record number can have one of these prefixes:
    K
    Indicates the change involved a key.
    X
    Indicates that although it was eligible to be changed, the change could not be performed due to record length restrictions.
    KX
    Indicates both of the above.
  3. Press F3 (Exit)

    The PDS Find/Change pop-up window appears.

  4. Press Enter to save or F3/End to cancel changes.

Related topics