In addition to requesting a certain position within a record, many keywords can reference a particular field by its name. The field name must be defined in the record layout, which must be available through the use of the LAYOUTFILE keyword or through the default ddname LAYOUT. Referencing the field name makes it easier when selecting or manipulating the record's data.
If the keyword specifies a value to compare to the field name that is less than the field-name's length, the compare value is padded to the field-name's length. If the compare value is defined as character or text, the value is left justified and padded with spaces. All numeric compare values are right justified and filled with leading zeros. If the length of the compare field is shorter than the field-name, we recommend that you use a data type that matches the field-name. If the compare uses the contains operator (CO), no padding takes place.
This example locates all records that have a CUST-TOTAL-MNTHLY-PYMNTS field whose value is greater than 1000. (By using the N, numeric, data-type, you do not have to know how the field is defined. CA File Master Plus makes the correct selections.)
SELRECIF(CUST-TOTAL-MNTHLY-PYMNTS,GT,N'1000')
The next example changes all records whose CUST-ID field's value is C'ABC ' from C'ABC ' to C'9ABC ':
CHANGE(CUST-ID,EQ,C'ABC',C'9ABC')
You may reference specific indexed fields, those fields defined by the OCCURS clause, by supplying the field's indexed value. For example, the following example references the CUST-MONTHLY-PYMT's third occurrence:
CHANGE(CUST-MONTHLY-PYMT(3),GT,N'50.00')
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|