skip to main content

Procedure Division Statements : IF

IF
General Format
IF Condition THEN { statement-1   }
  [ ELSE statement-2 [END-IF] ]
  [ ELSE NEXT SENTENCE        ]
  [ END-IF                    ]
Syntax rules
1.
2.
 
IF statements within IF statements are considered matched IF, ELSE, and END-IF ordered combinations, proceeding from left to right. Any ELSE encountered is matched with the nearest preceding IF that either has not been already matched with an ELSE or has not been implicitly or explicitly terminated. Any END-IF encountered is matched with the nearest preceding IF that has not been implicitly or explicitly terminated.
3.
General rules
1.
2.
3.
4.
5.
6.
7.
Examples
Evaluate condition to process interest computation
if ws-amount not > 0
   exit paragraph
   perform compute-interest
display message "Interest computed : " ws-interest

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left