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

HardExst

Use this field level rule to place a value into a field only if a record is found in the extract data using the search criteria you specify in the data field. This rule supports overflow.

Syntax

HardExst ( )

For instance, you could use this rule to see if there is a record in an extract file that corresponds to a field designating whether or not the applicant is a home owner. If the data exists in the extract record, the rule could then place an X in the Home Owner field.

You can use these format flags:

Flag

Description

C

Center

R

Right justify

The system justifies the data by adding spaces in front of the text. If you are using a proportional font, do not use these flags to align the data. Use the JustFld rule for that.

Search masks and overflow

Overflow affects how the search mask is used. Keep in mind that the rule uses the entire search mask, not just part of it. In this way, the HardExst rule differs from the PrintIf rule.

For example, if you specify this search mask:

11,DETAILREC,28,Y

it appears that the system checks to see if the record contains a Y in the 28th position. Instead, this mask really tells the system to find a row with DETAILREC at offset 11 and with a Y in the 28th position. This may sound like the same thing, but it is not.

Before the rule supported overflow, the answer could only be Yes or No—either you have such a record in your extract file or you don’t. For example, suppose you have these rows in an extract file:

HEADERREC0

DETAILREC0Y

And, suppose you specify the HardExst rule without overflow and with this search mask

1,DETAILREC,11,Y

In this case, the answer would be Yes — you do have such a record.

Now suppose you have these rows in your extract file and you are still not using overflow with the rule:

HEADERREC0

DETAILREC0N

DETAILREC0Y

The HardExst rule, even without overflow, will find the record that matches the search mask. Therefore, the answer is still Yes—you do have a row with DETAILREC at offset 1 and a Y in offset 11.

If you introduce overflow the result does not change. There is still only one record that has DETAILREC at offset 1 and a Y in offset 11. The first overflow variable will have the value you assign, while all the rest will not.

Although it may seem like you are searching for DETAILREC and you want to know if there is a Y in the 11th position, this is not what you are specifying. You are specifying that a row must have both criteria to match.

That is the difference between the PrintIf rule (which also now supports overflow) and the HardExst rule. For the PrintIf rule, you would use a less specific search mask of 1,DETAILREC and then use the if part of the rule to determine if the row contains the value you want. There are two records that match the less specific search mask of 1,DETAILREC. The first does not have a Y in the designated position, but the second does.

What you have to note is that the HardExst rule, like any other rule, uses the entire search mask to find matching rows—not just part of the mask. Therefore, only use the HardExst rule in overflow conditions to determine how many matching rows are found—rather than to try to find out if a row does or does not match the criteria.

How data is returned

The HardExst rule with overflow does not return data in the same order that the search criteria appears in the extract file. For example, suppose you would like to return the value X in a variable field named CHECKBX based on this search criteria:

11,AUTOREC,40,CHECKBX

The variable field is set up for overflow.

;0;1;CHECKBX;0;0;CHECKBX;0;0;;hardexst;@GETRECSUSED,OVFSYM1,MYIMAGE/11,AUTOREC,40,CHECKBX X;;;;

In the extract file, assume there are five occurrences of 11,AUTOREC. The first, third, and fifth occurrence of 11,AUTOREC does not have CHECKBX in offset 40 but the second and fourth occurrence of 11,AUTOREC does have CHECKBX at offset 40.

SCO12345678AUTOREC

SCO12345678AUTOREC CHECKBX

SCO12345678AUTOREC

SCO12345678AUTOREC CHECKBX

SCO12345678AUTOREC

The system does not leave the first, third, and fifth occurrences of the variable field blank and populate the second and fourth occurrence. The system finds the two occurrences of 11,AUTOREC,40,CHECKBX, populates the first two occurrences of the variable field with X, and leaves the last three occurrences of the field blank.

See also