What COBOL construct is the COBOL II EVALUATE meant to replace?

EVALUATE can be used in place of the nested IF THEN ELSE statements.

Showing Answers 1 - 4 of 4 Answers

Previndra Sharma

  • Sep 2nd, 2006
 

Hi,

In fact, Evaluate constructs case structure. we can also replace it by using nested if. It is simple in use with less complexity

Sathish kumar D

  • Jul 27th, 2007
 

EVALUATE statement contrusts a case structure. The explicit scope terminator for EVALUATE is END-EVALUATE. The various cases can be places between the EVALUATE and END-EVALUATE statements.

Example:

Here SQLCODE is a built in variable name

EVALUATE SQLCODE
     WHEN 0 
                DISPLAY ' FETCHED RECORDS'

     WHEN 100 
                DISPLAY ' NO RECORDS FOUND'
     WHEN OTHER 
                DISPLAY ' SQL ERROR CODE :' SQLCODE
END-EVALUATE

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions