Illustration of if- else statement, COBOL Programming

Assignment Help:

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.


Related Discussions:- Illustration of if- else statement

Move corresponding - cobol verb, MOVE CORRESPONDING: It is frequently ...

MOVE CORRESPONDING: It is frequently required to move some of the data items of one group to some other data items in the other group. If the names of the equivalent data item

Write statement, WRITE STATEMENT: The WRITE Statement verb releases a r...

WRITE STATEMENT: The WRITE Statement verb releases a record in an output file. The syntax for the WRITE statement can be unlike depending on the output device and the medium us

Relative files, RELATIVE FILES: The Files that are stored on a direct ...

RELATIVE FILES: The Files that are stored on a direct access storage medium like magnetic disk are frequently known as direct access files. The COBOL supports three different

Occurs clause, Occurs Clause: Let us establish tables with the help of...

Occurs Clause: Let us establish tables with the help of an illustration. Assume that there are ten different types of income-tax rates that are read from some input medium and

Literals - cobol program, Literals: The actual values can too appear i...

Literals: The actual values can too appear in a program. These values are termed as literals. For illustration, the statement MOVE 0 TO TOTAL indicates that the value zero wil

Program for renames clause, PROGRAM FOR RENAMES CLAUSE: identification...

PROGRAM FOR RENAMES CLAUSE: identification division. program- id. environment division. data division. working-storage section. 01 emp.      02 empdet.

Program for output file that can be our vsam file, We have input file, reco...

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 f

Sign condition - cobol programming, SIGN CONDITION:   The sign condit...

SIGN CONDITION:   The sign condition establishes whether or not the algebraic value of an operand is negative, positive or zero. The operand can be either the numeric identif

Search verb, SEARCH VERB: The SEARCH verb is used to position elements...

SEARCH VERB: The SEARCH verb is used to position elements in one-dimensional tables. Let us consider the following problem. Assume that each element of a table consists of thr

Illustration of the abbreviation - compound condition, Illustration of the ...

Illustration of the abbreviation: A few illustration of the abbreviation are given below: Illustration: The compound condition  AMOUNT GREATER THAN 499 AND AMOUNT L

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