IBM RPG400 Question:
Download Questions PDF

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

Answer:

There is no comparision 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 transfered the control
to ENDDO not out of the loop like LEAVE ie it just skip the
excecution of statements between ITER and ENDDO.

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

Download IBM RPG400 Interview Questions And Answers PDF

Previous QuestionNext Question
How can we search particular records from the database file in RPG. For example, there are
100 records in the file.i need to retrieve all the records matching/equal to the particular NAME field. How can we do the above using SEARCH criteria other than using the IF cond?
Errors in Sql query will be in which state?