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.
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.