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
File Description for the Relative and Indexed Files: The FD entry for a relative or an indexed file is similar to that of a sequential file. Some compilers do not permit varia

PROGRAM FOR SIZE ERROR:   We have to write an easy program to elaborate the size error option. Identification division. Program- id. sizeerr. Environment division.

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

Plus Sign - edit characters for numeric data: + (Plus Sign) : A plus sign is alike to minus sign except that when the item is positive, +sign will be inserted rather th

Example of compound condition: In common, a compound condition has the form which is as shown below: Where condition-1 & condition-2 can be any one of the below:

PERFORM WITH UNTIL OPTION: The format is as shown below: Illustration:  A) Perform p-3 until i > 5. Here p-3 will be executed whenever i B)  Perform p-2 thru

Illustration of indexed tables: Index items defined through the INDEXED phrase of the OCCURS clause are one type of indexes. There can be other type of index items that are de

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

Example of read statement: Illustration: READ OLD-MASTER AT END MOVE ZERO TO END-OF-RECORDS. As a result of this statement, generally the next record from the OLD-MAST

SEQUENTIAL FILES:   The purpose of the proposed section is to introduce the concepts such as File characteristics, File Description for Fixed-Length Records, File-Control