Compound condition, COBOL Programming

Assignment Help:

COMPOUND CONDITION:

The two simple conditions can be connected by the logical operators AND or OR to form a compound condition (also termed as combined condition). When two conditions is join by AND, then the compound conditions become true only whenever both the constituent conditions are true.

In all other situation the compound condition is false. On the other hand, if OR is used to join two conditions, then the compound condition is true if either or both the constituent conditions are true. It is only false when both the conditions are false.

For illustration, the compound condition AMOUNT GREATER THAN 499 AND AMOUNT

LESS THAN 1000 is a compound condition that will be true only when the value of the AMOUNT is in the range of 500 to 999.This is as both the simple conditions are true for these values of AMOUNT. For another values of AMOUNT, only one of them is true. Likewise, the compound condition AMOUNT LESS THAN 500 OR AMOUNT GREATER THAN 999 will be false only when the value of AMOUNT is in the range of 500 to 999.

The compound condition can consist of any number of simple or negated simple conditions joined either by AND or OR. The Compound conditions in such cases are resolved as shown.

Negated simple conditions are computed first. This is followed by the computation of pairs of

The resulting conditions around each AND in a left-to-right order. Afterward the resulting conditions around each OR are computed in a left-to-right manner. If needed, parentheses can be used in the compound conditions. In such situations all the conditions within the parentheses are computed first in accordance with the above rules. Whenever parentheses are used within parentheses, computation proceeds from the least inclusive pair of the parentheses to the most inclusive pair. 


Related Discussions:- Compound condition

Record description for the variable-length records, Record Description for ...

Record Description for the Variable-length Records: When the variable- length records consists of records of various lengths, each record type is to be explained at level 01 f

Program for multiply verb, PROGRAM FOR MULTIPLY VERB: We have to write...

PROGRAM FOR MULTIPLY VERB: We have to write a simple program to elaborate MULTIPLY verb. You can also use the edit characters in the program. Identification division. Pr

Example of on size error option, ON SIZE ERROR OPTION: Whenever a size...

ON SIZE ERROR OPTION: Whenever a size error occurs, the contents of the result field after the operation is unpredictable.  Though, the processing is not-terminated and the co

File updation, FILE UPDATION: The method of modifying an old file with...

FILE UPDATION: The method of modifying an old file with present information is termed as file updating. Master file: A master file is a file which is used as an author

#title.cobol help , we have input file ,record layout is EMP ID (6 char) , ...

we have input file ,record layout is EMP ID (6 char) , EMP NAME (20 char), Designation (3 char),Salary (5 digit) Base Branch (10char) Grade (3 Alphanumeric). This is the input file

Write statement - indexed files, WRITE STATEMENT: The records are wri...

WRITE STATEMENT: The records are written to be logical place as determined from the value of the record key. The INVALID KEY condition occurs in the cases shown below: (i)

Environment division - cobol programming, Environment Division: The En...

Environment Division: The Environment Division is the second division in the COBOL source program. It is mainly machine-dependent . The computer and all the peripheral dev

Program for electricity bill, PROGRAM FOR ELECTRICITY BILL: An electri...

PROGRAM FOR ELECTRICITY BILL: An electricity company supplies electricity to 4 types of customers coded 1, 2, 3 & 4.The rate schedule for customers is shown in one table as

Reserve clause and organization/access clause, RESERVE clause: This cl...

RESERVE clause: This clause indicates the number of buffers to be used for the file. Integer-1 specifies this number. ORGANIZATION/ACCESS clause: These two clause

File volatility and file interrogation, File volatility: File volatili...

File volatility: File volatility associates to the number of times the updating of records are needed during some time period. File interrogation: Some files hold re

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd