Changing data using the CHANGE command


Use the CHANGE primary command to search for a specified value or condition and change it to a new value. If File-AID finds a match, it changes the data to the new value that you specify. If you enter the CHANGE command without specifying any parameters, File-AID displays the CHANGE Command screen where you can enter your change parameters.

Initiate a Change - CHANGE Command With No Parameters

image2021-6-16_12-17-44.png

Related topics

Steps:

  1. Type CHANGE in the COMMAND field.
  2. Press Enter. File-AID displays the CHANGE Command screen as shown in the following figure.

CHANGE Command Prompt Screen

  File-AID  -----------------  CHANGE Command -----------------------------------
  COMMAND ===>

  Specify CHANGE operands:
     Operator         ===>          (EQ, NE, LT, GT, LE, GE)
     From string      ===>
     To string        ===>
     Modifier         ===> NEXT     (NEXT, ALL, FIRST, LAST, PREV)
     Lines to search  ===>          (NX = Nonexcluded; X = Excluded; Blank = all)  

  Specify the Following Fields to Limit the Range of Search for this CHANGE:
      Field name     ===>
         or
      Field number   ===>
         or
      Start column   ===>         End column ===>          (Column number(s))
      Start range    ===>         End range  ===>          (Label or line number)  

  NOTE: You may bypass this screen by entering the CHANGE command with operands:
  CHANGE  string         string2   (NEXT)   (NX)  (col-1 (col-2))   (range)
  CHG     (op) string              (ALL)    (X)   (/field name)
  C       VALID                    (FIRST)        (/field number)
          INVALID                  (LAST)
          ANY or *                 (PREV)

Specifying the CHANGE parameters

Use the CHANGE Command prompt screen to enter your change criteria. Using this screen helps you to enter valid values and to learn about the CHANGE command syntax.

CHANGE Command Screen - CHANGE ALL INVALID to 0 (zero)

image2021-6-16_12-19-3.png

Steps:

  1. Type INVALID in the "From string" field.

    Using the INVALID keyword in the "From string" field tells File-AID to search the specified field for data that does not match its field declaration in the record layout.

  2. Type a 0 (zero) in the "To string" field.

    The value you enter in the "To string" field is the value that you want File-AID to substitute for the "From String" value. In this case, for any value that File-AID finds to be invalid.

  3. Type ALL in the Modifier field.

    The ALL modifier tells File-AID to search all records for the condition you specified.

  4. Type EMP-NATL-TAX-WITHOLD-PCT in the "Field name" field.

    This value tells File-AID which field in the layout to search for invalid values.

  5. Press Enter. File-AID applies the CHANGE command as illustrated in the following figure.

CHANGE Result

After the CHANGE, File-AID displays record number 4 on the Edit screen with EMP-NATL-TAX-WITHOLD-PCT positioned at the top of the display and a value of 0 (zero) has replaced the invalid value. The cursor is placed on the new 0.

The message, EQ INVALID CHANGED, appears in the top right-hand corner of the display. Press PF1 (HELP) for details regarding the number of times File-AID applied the change you specified (message for this example: XVJFS410 FS410-/EMP-NATL-TAX-WITHOLD-PCT EQ INVALID - changed to 0 3 times on 3 record(s).).

Edit - CHANGE Result - INVALID Data In Record 4 Changed

 File-AID - Edit - USERID9.FASAMP.EMPLOYE1 ----------------- EQ INVALID CHANGED
 COMMAND ===>                                                  SCROLL ===> PAGE
 RECORD:      4                 EMPLOYEE-MASTER-FILE             LENGTH:     198
 ---- FIELD NUMBER/NAME ------ -FORMAT- ----+----1----+----2----+----3----+----4
 ******************************** TOP OF DATA **********************************
 1 EMP-NUMBER                    5/AN   10000                                   
 2 EMP-LAST-NAME                15/AN   ANDREWS                                 
 3 EMP-FIRST-NAME               10/AN   GEORGE                                  
 4 EMP-MID-INIT                  1/AN                                           
 5 FILLER                        2/AN                                           
 6 EMP-TITLE                    30/AN   ACTOR                                   
 7 EMP-PERSONAL-INFO            23/GRP                                          
   8 EMP-NATL-ID-NUMBER          9/NUM  576312032                               
   9 FILLER                      1/AN                                           
   10 EMP-DATE-OF-BIRTH          6/AN   042248                                  
   15 EMP-HIRE-DATE              6/AN   920131                                  
   16 EMP-MARITAL-STATUS         1/AN   S                                       
 17 EMP-WITHOLD-INFO            15/GRP                                          
   18 EMP-LIFE-INS-WITHOLD-AMT   6/SNUM 0                                       
   19 EMP-NATL-TAX-WITHOLD-PCT   3/PS   0                                       
   20 EMP-REGION-TAX-WITHOLD-PCT                                                
                                 3/PS   25.00                                   
   21 EMP-LOCAL-TAX-WITHOLD-PCT                                                 
                                 3/PS   15.00


More about the CHANGE command

You can specify the CHANGE command parameters on the CHANGE Command screen or specify the parameters with the CHANGE keyword in the COMMAND field.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*