compute verbthe compute verb is very powerful all


COMPUTE VERB:

The COMPUTE verb is very powerful. All the evaluations performed by the other 4 verbs can also be completed easily by using the COMPUTE verb. Its normal format is:

          COMPUTE        identifier-1    ROUNDED   ,   identifier-2  ROUNDED     ... 

         =   arithmetic-expression       ;   ON SIZE ERROR imperative-statement

The COMPUTE Verb statement has the following meaning. During the execution of the arithmetic expression on the right side of the equal sign is computed and the value is then moved to the identifiers(s) on the left-hand side.  If any identifier on the left side of the equal sign is a numeric-edited item, then the editing takes place when the value of the expression is moved to the said identifier. The identifiers on the left side of the equal sign (=) should be numeric or numeric-edited elementary items. The right-hand side should be an arithmetic expression. They can also be an identifier (only numeric elementary items), a numeric literal or can specify a computation including two or more such identifiers and/or literals. The arithmetic expression has always a numeric value.  

 

Request for Solution File

Ask an Expert for Answer!!
COBOL Programming: compute verbthe compute verb is very powerful all
Reference No:- TGS0174252

Expected delivery within 24 Hours