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 (=):
- This item is comprised of a logical operator and numeric value to be used in the comparison. The logical operators supported are:
Operator |
Description |
= |
equal to |
> |
greater than |
< |
less than |
<> |
not equal to |
Blank |
(default) No comparison occurs, text is moved to output buffer |
- Character string (inside quotation marks) to be placed in the output buffer if the comparison is true.
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.
- If the value from the extract record is equals to 40.0, the string Forty years old. is moved to the output buffer.
- If the value from the extract record is greater than 50, the string Greater than 50 is moved to the output buffer.
- If the value from the extract record is less than 30.0, the string Less than 30 is moved to the output buffer.
- If the value from the extract record is not equal to 20.00, the string Is not 20 is moved to the output buffer.
- In this definition, the logical operator does not exist so no comparison is made. If one of the other four user-defined condition is not true, the string 29 years old. is moved to the output buffer.
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
© Copyright 2020, Oracle and/or its affiliates. All rights reserved. Legal notices.