The FIND Function

The FIND function, used with COMBINE structures in FOCUS MODIFY procedures or with any file in a Maintain procedure, verifies the existence of a value in another data source. The FIND function sets a temporary field to 1 if the value exists in the other data source and to 0 if it does not. FIND does not return any actual data values.

Use FIND only with a data source referenced in a COMBINE command or a MAINTAIN FILE command. With COMBINE, if the FIND is for a field in a VSAM file, this field must be the index or alternate index field. For Maintain, the field must be indexed only if it is in a FOCUS data source.

The syntax for the FIND function is

rfield/I1 = FIND(fieldname AS dbfield IN file);

where:

rfield

Contains the return code (1 or 0) after the FIND function executes.

fieldname

Is the comparison field from one COMBINE data source or one data source referenced in a MAINTAIN FILE command.

dbfield

For MODIFY, is the field in another COMBINE file structure or an indexed field in a VSAM file, to use for the value comparison. The AS dbfield clause is optional if rfield and dbfield have the same name.

For Maintain, is a fieldname from one of the files listed in the MAINTAIN FILE command, qualified with its file name.

To use this feature most efficiently with Adabas, specify a field for which an Adabas descriptor has been established.

file

In MODIFY, names the data source or VSAM file in which dbfield resides. In Maintain, is ignored.

The FIND function is only supported within MODIFY or Maintain procedures. For more information, consult your FOCUS documentation.


Information Builders