Table of Contents

Search

  1. Preface
  2. Introduction
  3. Installation
  4. Design
  5. Operation

Search Logic

Search Logic

Search-Logic
or
KEY-LOGIC
defined in the
Clustering-Definition
and/or
Search-Definition
instructs DCE how to build search ranges to access the IDT using the index.
There are two types of Search-Logic (Key-Logic):
  • SSA
  • User

Search Logic (SSA)

Search-logic (Key-Logic) facilities are provided by SSA-NAME3 Population Rules.
KEY|SEARCH-LOGIC=SSA, System(system), Population(population), Controls(controls), Field(keyfield_list), [Null-Field(null-field-value)], [Null-Key(null-key-value)]
where
system
Defines the System Name of the SSA-NAME Population Rule File. The
system
is a sub-directory of the population rules directory. The location of the population rules directory is defined by the environment variable
SSAPR
.
population
Defines the name of the Population file which is located in the
system
directory. The Population chosen will depend on the data being processed.
controls
Used to describe the data type of the Key Field data and to control the thoroughness of the search
For more details on the
Controls
, refer to the
SSA-NAME3 API REFERENCE GUIDE
under the
ssa_get_ranges
heading within the
Controls
section.
keyfield_list
This is a comma separated list of IDT fields to be used to generate keys or ranges. If more than one field is provided, the
keyfield_list
must be enclosed in quotes (").
null-field-value
An optional parameter that defines the null value for the
Field
. Records with a null value in their key field can be ignored by using the
NO-NULL-FIELD
option to prevent them from being stored in the IDT. The default value is spaces (blanks).
For example,
Null-Field("unknown")
null-key-value
An optional parameter that defines the value of a null key. Records with a null key can be ignored by using the
NO-NULL-KEY
option to prevent them from being stored in the IDX. The default value is "K$$$$$$$".
For example,
Null-Key("K$$$$$$$")
The above key value will be generated from a name containing null data or composed of only delete words.

Controls

A
Key-Logic
in an
IDX-Definition
controls the generation of keys. Therefore the Controls should specify the
KEY_LEVEL
. For example,
KEY-LOGIC=SSA, System(system), Population(population), Controls("FIELD=fieldname KEY_LEVEL=Standard"), Field(keyfield)
A Search-Logic in a Search-Definition controls the generation of search ranges. Therefore the Controls should specify a
SEARCH_LEVEL
. For example,
SEARCH-LOGIC=SSA, System(system), Population(population), Controls("FIELD=fieldname SEARCH_LEVEL=Typical"), Field(keyfield)

Repeating Key Fields

The Field parameter of the Key- or Search-Logic can be used to generate keys or ranges for multiple fields (of the same type). This is accomplished by specifying a list of fields.
For example,
IDX-Definition *============= KEY-LOGIC=SSA, System(system), Population(population), Controls("FIELD=fieldname KEY_LEVEL=Standard"), Field("field_1,field_2,field_3")
will generate keys for all three name fields and store them in the IDX.
For search:
SEARCH-LOGIC=SSA, System(system), Population(population), Controls("FIELD=fieldname SEARCH_LEVEL=Standard"), Field("field_1,field_2,field_3")
will generate search ranges for all three name fields.
For Matching:
SCORE-LOGIC=SSA, System(system), Population(population), Controls("PURPOSE=purpose_name MATCH_LEVEL=Loose"), Matching-Fields("fieldn ame_1:Person_Name", "fieldname_2:Person_Name","textitfieldname_3:Person_Name")
Will apply repeat logic to all three name fields.
When indexing a Group of repeating fields (or flattened fields), you must list each individual field name. For example, the following source definition
test.person.nameName [5] C(20)
generates a Group in the File-Definition of this IDT, which is subsequently expanded to the following list of field names:
FIELD=Name, C, 20 FIELD=Name_2, C, 20 FIELD=Name_3, C, 20 FIELD=Name_4, C, 20 FIELD=Name_5, C, 20
Therefore a Key-Logic that indexes these fields must list each individual field:
KEY-LOGIC=SSA, System(default), Population(test), Controls("FIELD=KeyFieldName KEY_LEVEL=Standard"), Field("Name,Name_2,Name_3,Name_4,Name_5")
A shorthand method of specifying repeating fields exists and takes the form of:
field [ * | {x | y-z}, ... ]
Some examples of this notation are (assuming a maximum of 5 occurrences):
Name[1-5] = Name,Name_2,Name_3,Name_4,Name_5 Name[2,3] = Name[2-3] = Name_2,Name_3 Name[1,4-5]= Name,Name_4,Name_5 Name[5] = Name_5 Name[*] = Name,Name_2,Name_3,Name_4,Name_5
Therefore some of the ways the above Key-Logic example could also be written are:
KEY-LOGIC=SSA, System(default), Population(test), Controls("FIELD=KeyFieldName KEY_LEVEL=Standard"), Field("Name[*]") KEY-LOGIC=SSA, System(default), Population(test), Controls("FIELD=KeyFieldName KEY_LEVEL=Standard"), Field("Name[1-5]") KEY-LOGIC=SSA, System(default), Population(test), Controls("FIELD=KeyFieldName KEY_LEVEL=Standard"), Field("Name[1,2,3,4,5]")

Key Logic (User)

For
User
logic the value of the key field
fld
is used as the key.
KEY-LOGIC=User, Field(KeyFieldName)

0 COMMENTS

We’d like to hear from you!