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

PrtIfNum

This field level rule is similar to the PrintIf rule. The difference is the PrtIfNum rule compares the data to a number while PrintIf compares data to a character string.

A MoveNum action is performed on the value from the extract record and the resulting value is compared to the value in the user-defined conditions to determine what text should be placed in the output buffer. This rule supports overflow processing.

A user-defined condition is comprised of one or more user-defined definitions separated by a colon (:). A user-defined definition is comprised of these two items separated by an equal sign (=):

Operator

Description

=

equal to

>

greater than

<

less than

<>

not equal to

Blank

(default) No comparison occurs, text is moved to output buffer

Here are some examples of user-defined conditions:

=40="He is forty years old."

The logical operator is equal to, the numeric value is 40, and the character string if the comparison is true is He is forty years old.

>50="He is greater than 50 years old."

The logical operator is greater than, the numeric value is 50, and the character string if the comparison is true is He is greater than 50 years old.

<30="He is less than 30 years old."

The logical operator is less than, the numeric value is 30, and the character string if the comparison is true is He is less than 30 years old.

<>20="He is not 20 years old."

The logical operator is not equal to, the numeric value is 20 and the character string if the comparison is true is He is not 20 years old.

=40.0="Forty years old.":>50="Greater than 50":<30="Less than

30.":<>20.00="Is not 20.":29="29 years old."

This user-defined condition is comprised of five user-defined definitions.

Defining the MoveNum parameters

You must define the MoveNum parameters (format mask) in the PrtIfNum rule mask field. As a minimum, you must define the MoveNum input numeric format (X.Y) followed by the output numeric format (X.Y).

If data (offset, length) does not exist for the search mask, the value returned to PrtIfNum for the comparison is zero (0). Therefore, you may want to include a zero compare in the user-defined conditions.

For example, suppose you left the No check box blank if the data is three and an X if the data is a one, two, or four. These user-defined conditions...

=3=" ": <>3="X"

would not produce the desired results if the data was missing (blank). These conditions...

=0=" ":=3=" ": <>3="X"

would insert a blank if the data was missing.

See also