DO WHILE loops in a flowchart appear as follows:
DO WHILE expression /* expression must be true */
instruction(s)
END
Use a DO WHILE loop when you want to execute the loop while a condition is true. DO WHILE tests the condition at the top of the loop. If the condition is initially false, the language processor never executes the loop.
/******************************** REXX *******************************/
/* This program uses a DO WHILE loop to send a string to a */
/* user-written function for processing. */
/*********************************************************************/
PULL string /* Gets string from input stream */
DO WHILE string \= 'QUIT'
result = process(string) /* Calls a user-written function */
/* to do processing on string. */
IF result = 0 THEN SAY "Processing complete for string:" string
ELSE SAY "Processing failed for string:" string
PULL string
END
SAY 'Program run complete.'