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

Special-names - configuration section, SPECIAL-NAMES: This paragraph i...

SPECIAL-NAMES: This paragraph is used to associate some hardware names to the user-specified mnemonic names. This paragraph is elective in all compilers. The format of this pa

Handling file that was uploaded from a PC, I uploaded a file from PC to Mai...

I uploaded a file from PC to Mainframe, variable LRCL 256. In my COBOL program I defined it as FD INPUT-FILE LABEL RECORDS ARE OMITTED BLOCK CONTAINS 0 RECORDING MODE

Program to find interest on bank deposits, PROGRAM TO FIND INTEREST ON BANK...

PROGRAM TO FIND INTEREST ON BANK DEPOSITS: We have to write a program to find interest on deposits. The criteria is given below : identification division. program-

Example of nested if statement, Example of Nested if statement: Illus...

Example of Nested if statement: Illustration: Consider the following sentence The nested IF sentence holds two IFs and one ELSE. The IF-ELSE couple has been marke

Slash insertion - edit characters for numeric data, / (Slash Insertion): ...

/ (Slash Insertion): The edit character slash (/) also termed as virgule or stroke, may appear anyplace in the picture. When used, it will be inserted. More than one slash can

Rules of renames clause, RULES OF RENAMES CLAUSE:   The rules below s...

RULES OF RENAMES CLAUSE:   The rules below should be observed while using the RENAMES clause: (i) All RENAMES entries should be written only after the last record descript

Valid and invalid word - cobol words, Valid and Invalid Word - Cobol words:...

Valid and Invalid Word - Cobol words: Valid Word             Invalid Word & Reason emp-sal                  -pay   ( it starts with a hyphen)  TOTAL MARK (blank space em

Declarative and file status clause, DECLARATIVE and FILE STATUS Clause: ...

DECLARATIVE and FILE STATUS Clause: The input-output exception condition in the situation of a direct access files can be handled by a declarative procedure in a manner simila

Read statement, READ STATEMENT: The aim of this verb is to make availa...

READ STATEMENT: The aim of this verb is to make available the next logical record from the input file. It is important to note the meaning of the "next" logical record in the

Data names and identifiers - cobol program, Data Names and Identifiers:   ...

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

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