Illustration of the abbreviation - compound condition, COBOL Programming

Illustration of the abbreviation:

A few illustration of the abbreviation are given below:

Illustration:

The compound condition 

AMOUNT GREATER THAN 499 AND AMOUNT LESS THAN 1000

can be abbreviated to

AMOUNT GREATER THAN 499 AND LESS THAN 1000

Here, the second appearance of the general subject AMOUNT has been absent.

Illustration:

The compound condition

CARD-CODE    =    3    OR    CARD-CODE   =   5   OR  CARD-CODE   =  7

may be abbreviated to

CARD-CODE   =  3   OR   5   OR   7

In this, the subjects as well as the relational conditions in the given compound condition are similar. Accordingly, the second and third appearances of the subject and the relational condition have been absent.

The consecutives relational conditions which are being considered for the abbreviation may also hold the word NOT. In this situation the interpretation of the abbreviated condition can become ambiguous. To solve the ambiguity the rule below has been recommended in the ANS I standard. The term NOT preceding a relational operator in an abbreviated condition is considered part of the relational operator. Or else, NOT is considered to be a logical operator negating the condition preceded by it. The illustration below can help to understand this rule.

Illustration:

The condition

AGE LESS THAN 30 AND NOT LESS THAN 20 OR 40

is interpreted to be the abbreviation of a compound condition AGE LESS THAN 30 AND AGE NOT LESS THAN 20 OR AGE NOT LESS THAN 40

This is because the NOT precedes the relational operator LESS THAN in the abbreviated condition and as such it is interpreted to be a section of the relational operator NOT LESS THAN.

Posted Date: 10/17/2012 1:50:00 AM | Location : United States







Related Discussions:- Illustration of the abbreviation - compound condition, Assignment Help, Ask Question on Illustration of the abbreviation - compound condition, Get Answer, Expert's Help, Illustration of the abbreviation - compound condition Discussions

Write discussion on Illustration of the abbreviation - compound condition
Your posts are moderated
Related Questions
Comparison of Nonnumeric Operands: A nonnumeric operand can be compared to the other nonnumeric operand according to the rules as shown below: (i) Fields of Equal Sizes:


OPEN statement: We know that the processing of a file should start with the execution of an OPEN statement. The file can be opened in any one of the 4 open modes - INPUT, OUTP

Example of Special-names: Consider the illustration: Let the SPECIAL-NAMES paragraph be as shown: SPECIAL-NAMES. CHANNEL 1 IS PAGE-TOP. The Channel is related with the t

Data Names and Identifiers:   The Data name provides reference to the storage space in the memory where the real value is stored. This value takes part in the operation whene

DELETE STATEMENT : The file should be opened in the I-O mode. If the access is SEQUENTIAL, the INVALID KEY phrase must be specified. Rather than, the last input-output state

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below:

INPUT-OUTPUT SECTION: This section holds information regarding the files to be used in the program. There are 2 paragraphs in this section- FILE-CONTROL & I-O-CONTROL. The

OCCURS CLAUSE - PROGRAM: We have to write a program to demonstrate the occurs clause. Get names of the students and show them on the screen.  identification division.

FILE STATUS clause: This clause has been involved in the above syntax for completeness. The ORGANIZATION, REVERSE, ACCESS and STATUS clause can be specified in any order.