Creating Conditional Statements

A conditional statement selects a subset of records from the file for generating the report or mass load display. Use a combination of conjunctions, dictionary item names, operators, and comparison values to create the conditional statement.

We recommend that you attend a Report Writer/Mass Load class to learn how to use variables and placeholders in conditional statements. The following sections describe basic rules for creating conditional statements:

Standard Report Writer/Mass Load Selection Screen

Use the guidelines in the following table for creating a conditional statement on the standard Report Writer/Mass Load screen:

In this column...

Enter...

Conj

a term that links the condition defined on a given line to the condition defined on the previous line in a multi-conditional selection statement.

  • *** designates the beginning of a conditional statement.

  • AND indicates that the condition on the previous line and the condition on the given line must both be true for a record to be selected.

  • OR indicates that either the condition on the previous line or the condition on the given line must be true for the record to be selected.

  • GET identifies the name (in the Compare To column) of a previously saved Select List that was created in TCL (True Command Language) using UniVerse RetrieVe commands. If used, this must be on the first line of the first Select.

Dictionary Name

the dictionary item to use for this conditional statement.

For each record entering the selection process, the system compares the value in this field to the value in the Compare To column using the operator entered in the Op column, and determines whether the record meets the selection criteria.

Op

an operator that expresses the condition. Press F10 and select one of the following options:

  • = Equal To

  • # Not Equal To

  • < Less Than

  • > Greater Than

  • <= Less Than or Equal To

  • >= Greater Than or Equal To

Compare To

the value to which the system compares each designated dictionary item, to determine whether to select the record for the report. This can be:

  • A dictionary item from the file used to create the report or mass load.

  • One or more text strings enclosed in quotation marks. The system infers a logical OR between multiple strings. For example, "SMITH" "JONES" means Smith or Jones.

  • A null or blank value.

  • A user-defined prompt.

The value you enter can use the following wildcard characters:

  • To select any record whose dictionary value ends with the text string entered, enter a string of characters preceded by a left square bracket, such as [ING.

  • To select any record whose dictionary value begins with the text string entered, enter a string of characters followed by a right square bracket, such as GAR].

  • To select any record whose dictionary value contains that text string anywhere in the value, enter a string of characters preceded by a left square bracket and followed by a right square bracket, such as [DESC].

  • To select any record whose dictionary value starts and ends with designated text, but can contain anything in between, use the "^" symbol as a one-character wildcard. For example, use B^^^ING to select any 6-letter word that begins with B and ends with ING.

To have the system prompt you to enter a Compare To value at the time the report or mass load runs, type a character or word between two dollar signs, such as $STATE$. The text between the dollar signs is not the prompt. By default, the system uses the corresponding dictionary item's Prompt value. Use the Edit Prompts hot key to view or change the prompt.

Advanced Report Writer/Mass Load Selection Screen

On the Advanced Report Writer/Mass Load Selection screen, enter the same type of conditional statement described for the standard selection screen using the standard TCL retrieve sentence operators. This screen does not display the different parts of the statement in separate columns. You can enter up to five conditional statements on this screen.

See Also:

Using Standard Record Selection

Using Advanced Record Selection