just simple coding for you.. follow this..
F emp if e disk -> declare my PF
C *hival setll employee -> set high value in pf record
C dow not %eof
C readp employee
C empno dsply
C eval *inlr = *on
If there are 8 records empno is displayed 9 times
Also, better to code %eof(employee)
your correct Mr. Phil, but i got error on the %eof line
error is -> Parameter EMPLOYEE is not valid for built-in function %EOF.
Yes, %eof(EMP) <- file name not record format name
…read a physical file in reverse order by rpg/400 program,condition is there is not any key field…
If there is no key, how are you defining “reverse order”? Do you want them in the reverse order that records were added to the file? Do you want them in reverse order based on relative record number? Do you want to read them in reverse order of the values of fields in the file? (They don’t have to be “keys” to do that.) Or do you have a different definition? Each way can have a different method.
…by rpg/400 program
And does it have to be RPG/400? Why not use RPG from this century?
The code samples shown responding to this question pass muster for RPG IV but are not RPG/400.
We know it often doesn’t really matter. But it’s disturbing how often it actually does.