Substituting Data. Substitutes for the contents of an attribute either the data in another attribute or a specified character string.
Format
S ; attr ; 'string' |
Parameter(s)
attr |
Attribute number of the attribute whose data is to replace the stored data (if any exists). |
string |
Character string that is to replace a zero. |
Description
The attribute whose data is to be replaced is the one referenced by the attribute number in line 2 of the Attribute Definition item containing the S code.
If a value in the referenced attribute is zero, a character string specified in the S code is substituted.
If a value in the referenced attribute is not zero, then the value in the attribute specified by the S code is substituted.
If there is no value in the referenced attribute (that is, if the value is null), no value is substituted and nothing is returned.
To retain the original value of the referenced attribute (the attribute specified on line 2), use an asterisk (*) in place of the attr parameter.
For example, the Attribute Definition item for Attribute 6, PAYMENT, in the OVERDUE.ORDERS file contains the correlative:
S ; 3 ; 'NONE' |
This correlative specifies that if the value in Attribute 6 is zero, the string NONE is substituted. If the value in Attribute 6 is not zero, then the data in Attribute 3, CHECK-AMOUNT, is substituted.
The S correlative thus makes it possible to bypass the original (out-of-date) data in the PAYMENT attribute.
See Also