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.

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 )

Google photo

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

Twitter picture

You are commenting using your Twitter 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.