var ( j k )
This notation provides a way to specify certain positions in a string. It is similar to the substring function. The string value of var is evaluated from the jth character to the kth character. Since var( j k ) is evaluated at compile time, it is more efficient than substr(var, pos, len ) and should be used when variable arguments are not needed. The parameters j and k are numeric constants. For more information, see “
Field Variables”.
Example 1
addr1 = $0(25 42); #
Set addr1 to the string in positions 25 through 42 of input
Example 2
ssn = ssn(1 3) + ssn(5 6) + ssn(8 11); #
Eliminate separators from ssn
Last modified date: 07/26/2024