IBM AS400 Question:
Download Questions PDF

What is the difference between ITER and DO? We know both are used to execute set of statements repeatedly, but what is the main difference?

Answer:

There is no comparison between DO and ITER as DO statement
is an looping statement and ITER is an branching statement
like LEAVE.
When I use ITER with some condition inside a DO-ENDDO loop,
when that condition occouerd, ITER transferred the control
to ENDDO not out of the loop like LEAVE ie it just skip the
execution of statements between ITER and ENDDO.

In one statement we can say that ITER in RPGLE is same as
CONTINUE in C.

Download IBM AS400 Interview Questions And Answers PDF

Previous QuestionNext Question
Explain this error: "All Record Formats for externally-described file ABCD ignored or dropped due to error; file ignored."?What are the commands that can be executed in CLP but not in RPG? Why?