Home > Software > Mainframe > Cobol
Interview Questions   Tutorials   Discussions   Programs   

Cobol - What are 2 of the common forms of the EVALUATE STATEMENT ?




410
views
asked mar August 22, 2014 01:09 PM  

What are 2 of the common forms of the EVALUATE STATEMENT ?


           

1 Answers



 
answered By Mswami   0  
Simple Example of the EVALUATE Statement:

EVALUATE MENU-INPUT
  WHEN "0"
    PERFORM INIT-PROC
  WHEN "1" THRU "9"
    PERFORM PROCESS-PROC
  WHEN "R"
    PERFORM READ-PARMS
  WHEN "X"
    PERFORM CLEANUP-PROC
  WHEN OTHER
    PERFORM ERROR-PROC
END-EVALUATE.


Complex Example of the EVALUATE Statement:

EVALUATE A = B ALSO C > D ALSO TRUE
  WHEN TRUE  ALSO TRUE  ALSO E = F + 15
    imp-stat-1
  WHEN TRUE  ALSO TRUE  ALSO E > 12
    imp-stat-2
  WHEN TRUE  ALSO FALSE ALSO ANY
    imp-stat-3
  WHEN FALSE ALSO TRUE  ALSO ANY
    imp-stat-4
  WHEN FALSE ALSO FALSE ALSO ANY
    imp-stat-5
END-EVALUATE.

flag   
   add comment

Your answer

Join with account you already have

FF

Preview


Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!

Alert