Illustration of if- else statement, COBOL Programming

Illustration of if- else statement:

IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 BALANCE-CODE

In this illustration, the OK-BALANCE is a condition name. No action is specific if this condition is true. And when the condition is false, BALANCE-CODE must be set to 2. The sentence is equal to the following flow chart.

 

757_Illustration of if- else statement.png

It may be noted that any If sentence can be alternatively written by just negating the condition. In order to maintain the meaning of the unique sentence, the then and else parts are to be interchanged. Therefore the following sentence has similar meaning as the one illustrated above.

IF NOT OK-BALANCE MOVE 2 TO BALANCE-CODE ELSE NEXT-SENTENCE

If preferred, the ELSE NEXT SENTENCE phrase may be dropped to get the equivalent form as shown.

 IF NOT OK-BALANCE MOVE -2 TO BALANCE-CODE.

Posted Date: 10/17/2012 1:56:36 AM | Location : United States







Related Discussions:- Illustration of if- else statement, Assignment Help, Ask Question on Illustration of if- else statement, Get Answer, Expert's Help, Illustration of if- else statement Discussions

Write discussion on Illustration of if- else statement
Your posts are moderated
Related Questions
BLOCK CONTAINS CLAUSE: Integer -1 of the BLOCK CONTAINS clause indicates the block size either in terms of records or in terms of characters. For illustration, BLOCK CONTAINS

Data Division: The Data Division is a part of the COBOL program where every data item processed by the program is described. It is very important to note that unless a data

CONDITIONS-NAME CONDITION:   The condition name is an entity which itself is a condition and these can have either a true or false value. Though, a condition name cannot be d

Display control verbs in Cobol

File- Section &Working-Storage Section: a) FILE SECTION: The FILE SECTION includes the explanation of all data items that must be read from or written onto some external

PROGRAM TO DEMONSTRATE MERGE VERB: The two files for which a record having 2 fields viz. Account Number and Name are already available. Now Merge these two files and create a

cobol program for generate a eb bill

OCCURS - INDEXED BY PROGRAM: identification division. program- id. searching. environment division. data division. working-storage section. 01 table1.      0

PROGRAM FOR INDEXED SEQUENTIAL FILE CREATION: We have to write a program to create an Indexed Sequential File in a dynamic mode for Student particulars. Suppose just 3 fields:

UPDATING OF THE RELATIVE AND INDEXED FILES: The Sequential files are updated by creating a new master file from an existing old master file and a transaction file. Such an Upda