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
Illustration of Search verb: To illustrate the other use of SEARCH verb, assume we wish to search the similar tab to find the number of persons whose deposited amount is more

OPEN STATEMENT: Whenever a READ or a WRITE operation is executed on a file, then it should be open. The opening of a file may be completed with the help of the OPEN verb. With

WRITE Statement:      The WRITE statement for a relative file has the format which is as shown below.          WRITE  record-name   [ FORM   identifier ]

MULTIPLY VERB:   The Multiply Verb causes one or more multiplicands to be multiplied by the multiplier and to store the products. The form of the MULTIPLY verb is as shown be

NONSTANDARD CLAUSES: The various clauses explained above are as per the ANSI standard. Also, most compilers provide for additional nonstandard clauses to meet the specific nec

Character Set: To study any language, first one should know the alphabets of the language and they are termed as character set in general. There are 50 different characters in

STATEMENTS FOR SEQUENTIAL FILES: A basic operation on a file includes the reading and writing of its records. Whenever the file is sequential, there are three verbs for the

PROGRAM FOR IF -ELSE: We have to write a program to check whether the given number is ODD or EVEN. You can use IF..ELSE. Identification division. Program- id. IfElse.

REWRITE STATEMENT: As in the situation of a relative file, the REWRITE statement needs that the file should be opened in the I-O mode, and if the SEQENTIAL access mode is spec

Example of Write statement: Illustration: (i) WRITE TRANS-RECORD AFTER ADVANCING 3 LINES. This WRITE statement specified that the TRANS-RECORD is a record name of a fi