COBOL 88 level number/Conditional names

COBOL 77 Level Number COBOL Set Verb

Advertisements


A conditional variable is always subordinate to another data item.

Level number 88 used for conditional names.

Conditional name identifies the particular value associated to verify during the flow.

VALUE clause should be associated with conditional names.

Conditional names doesn’t occupy any storage.


Rules:

  1. No PICTURE clause is associated with 88 level number.
  2. 88 level number always associated with any other level number 01-49.
  3. Any conditional keywords(IF, EVALUATE) using the 88 level number mostly.

Syntax:

88 Condition-Name { VALUE/VALUES} { literal low-value {THROUGH/THRU} High-value}

Conditional name has advantage of using in three different formats which can be very useful in validating the data in programming.


Format1- Single value:

88 Condition-Name VALUE literal/ Figurative Constants

In this format, Condition names will have the only one value assigned to validate.

In the below example, MALE & FEMALE conditional variables represents the single value constants.


Format2- Multiple values:

88 Condition-Name VALUE literal-1 literal-2.. literal-n.

In this format, Condition names will have more than one value assigned to validate.

i.e. In a single condition, it can be used to validate more than once value.

In the below example, VALID-GENDER conditional variables represents the multiple value constants.


Format3- Set of values:

88 Condition-Name VALUE literal-1 THROUGH/THRU literal-n.

In this format, Condition names will have set of values assigned to validate.

i.e. In a single condition, it can be used to validate a set of values which will be started from one value to another in a sequence.

In the below example, FIRST-CLASS, SECOND-CALSS, THIRD-CLASS & FAIL conditional variables represents THRU/THROUGH value constants.


Practical Example:


Code:



Jcl:



Output:



SET verb is used to set the values by using 88 level number variables.


SET verb :


SET verb using to initializing the index of table.

SET verb is mainly used to set the particular item value to true. i.e. It is one way to assign a value to a particular data item.

SET verb can increment/decrement the occurrence of a data item.

SET verb can set the external data item switches to ON or OFF.

SET verb can pass values to conditional items to validate.

The Assumed decimal point topic explained in detail here


COBOL 77 Level Number COBOL Set Verb

Advertisements