Example of sign condition , COBOL Programming

Example of Sign condition:

The illustration below describes the use of the sign condition.

Illustration:

    77  BALANCE  PIC  S9 (6) V99.

      .

      .

    IF  BALANCE   IS   ZERO GO TO NIL-BALANCE.

It may be illustrious that the above IF statement is equivalent to the below statement which makes use of the relational condition.

    IF  BALANCE  =  0  GO TO NIL-BALANCE.

Illustration:

    02  DEPOSIT    PIC  9(4) V99.

    02  WITHDRAWAL  PIC  9(4) V99.

      .

      .

      .

IF  DEPOSIT  -WITHDRAWAL  IS  POSITIVE  GO TO CALCULATION.

The control is transferred to the paragraph named the CALCULATION if the present value of the DEPOSIT is greater than that of the WITHDRAWAL.

In normal, any sign condition can be substituted by an equivalent relational condition. Use of the sign condition might perhaps be convenient in many cases and it may also use to increase the readability of the statement which uses it.

Posted Date: 10/17/2012 1:40:01 AM | Location : United States







Related Discussions:- Example of sign condition , Assignment Help, Ask Question on Example of sign condition , Get Answer, Expert's Help, Example of sign condition Discussions

Write discussion on Example of sign condition
Your posts are moderated
Related Questions
PROGRAM FOR SCREEN SECTION:  identification division.   program- id.   environment division.   data division.   working-storage section.   01  a pic 9(2) value

VALUE CLAUSE: The value clause defines the preliminary value of the data item. Normally initialization will be completed just before the first statement in the procedure di

The LENDER Bank offers mortgages on homes valued up to $500,000. The required down payment is calculated as follows: 4% of the first $60,000 borrowed 8% of the next $30,000 borro

PROGRAM FOR INVENTORY  We have to write a program to update the inventory file. Consider 2 files,viz, invfile an tranfile. Invfile has 3 fields pno,name,qty. Tranfile has 3 fil

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

REWRITE statement: The REWRITE statement is used to update the existing record in a disk file. The normal format is as shown below: REWRIE  record-name  [  FROM      ide

Example of Accept statement: For illustration, ACCEPT FLAG-A can be specified to read the value of the FLAG_A from the console. It may be keep in mind that no file definition

SEQUENTIAL FILES WITH THE VARIABLE-LENGTH RECORDS: The Magnetic - tape or disk files can hold variable-length records. In this situation the file can have records with various

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

Example of Open statement: Illustration: The OPEN INPUT TRANSACTION, OLD-MASTER OUTPUT NEW-MASTER. The illustration represents that there are two input files named the