You are here: Field Rules Reference > Field Rules Summary > SetAddr2

SetAddr2

Use this field level rule to store and retrieve subsequent lines of a multiple line address. This rule is similar to the SetAddr rule in that it also omits blank lines from an address. The SetAddr2 rule, however, also formats the city, state, and postal code and adds a dash if you have a 10-digit postal code (postal+4). For instance, this rule automatically formats the city, state, and postal code as follows:

AtlantaGA 30333 (one space between state and zip code)

You can enter parameters in the Data field to format the address. The Data field accepts three parameters: a delimiter, an offset, and a second delimiter. The first delimiter is placed between the city and the state. The second delimiter is placed after the nth (offset) digit of the postal code. This rule always inserts a single space between the state and the postal code.

For example, if you enter ',^',5,'-' (where ^ represents a space) in the Data field (and if the postal code value contains 303331234), the SetAddr2 rule would format the city, state, and zip code as follows:

Atlanta, GA 30333-1234

In addition, you can also specify an S flag in the Data field to tell the system to suppress the state from the last address line. If you include this flag, the text is formatted as shown here:

Atlanta, 30333 (state code is suppressed)

The first time you call this rule, the format mask field must contain an F. This initializes the function and loads the lines of the address into an array. The system then returns the first line of the address data. Subsequent address variable fields should contain an N in the format mask field and return the next available non blank address line from the array.

The data element contains the parameters necessary to get the address record. The last three fields (city, state, postal code) are stored in one field. The various address data element mapping comes from the first record's data element (after the record mapping). This rule supports overflow.

Note An address line cannot exceed 256 characters.

Here are the optional format mask parameters you can use:

Parameter

Description

C

Converts to sentence style where the first character is capitalized and the remaining characters are lowercased.

D

Converts the data returned by the rule into lowercase.

U

Converts the data returned by the rule into uppercase.

See also