Loading

DO WHILE clause in Easytrieve

The syntax for a DO WHILE clause in Easytrieve is

 DO WHILE CONDITION1 [ AND CONDITION2 | OR CONDITION3 ]
   STATEMENTS TO EXECUTE
 END-DO

Please refer the below sample of code to use a do-while clause in Easytrieve.

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 LIST ON
 FILE INFILE 
*
 WS-COUNT W 4 N VALUE 0
*
 JOB INPUT NULL
 WS-COUNT = 1
 DO WHILE WS-COUNT LE 15 
   DISPLAY ' COUNT IS ' WS-COUNT
   WS-COUNT = WS-COUNT + 1
 END-DO
 STOP.

Related Posts




blog comments powered by Disqus

There's 0 Comment So Far

Share your thoughts, leave a comment!