Defining global fields


The Selection Criteria Menu lets you access the fours components of selection criteria:

OPTIONS

Control selection based on record counts

GLOBAL

Define and edit global fields (variables), which allows you to set indicators and save data values into variables within formatted Selection Criteria; these variables can then be compared as part of other Formatted Selection Criteria conditions.

FORMATTED

Use record layout to define tests for record data

UNFORMATTED

Define tests for record data without using layouts (by specifying location, length, operator, and data for each field to be tested).

The following example demonstrates how a global field can be used to select records based on conditions in previous records.

For this example, you are going to define a global field, activate the global field and perform tests with formatted selection criteria. Criteria Menu option G gives you access to the Define Global Fields screen.

Selection Criteria Menu Screen

image2021-6-18_16-42-21.png

Steps:

  1. Type G (GLOBAL Fields) in the OPTION field.
  2. Type GLOBAL &SAVESTATE MID-INIT C in the Member list description field.
  3. Press Enter.

Specifying the global field definition

Before you can use a Global field in selection criteria, you must first define it.

The Define Global Fields Screen, enables you to view, define and change user global fields. It lists all existing user variables and displays blank lines for definition of additional User variables. Global fields must start with & (ampersand) and they are retained in the order entered.

The example defines Global field &SAVESTATE as character data type with a length of 2.

Important

All references to the Global variable must be removed prior to deleting the Global variable.

Define Global Fields Screen

image2021-6-21_18-35-51.png

Steps:

  1. Type &SAVESTATE for the Field name to identify the variable.
  2. Type C in the Char/Num data type column to specify character data.
  3. Type 2 in the Length column to specify character data length.
  4. Type END in the COMMAND field to save and exit the Define Global Fields Screen.
  5. Press Enter.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*