How I can reread the physical file in CL program once the
end of file reached in same CL program.

Answer Posted / jim

Specify two DCLF for the same file with 2 different
openID's sayID1 and ID2
Tjen do RCVF on the file with open ID ID1 do the
processing, upon EOF then issue a 2nd RCVF for open ID2

the 1st record will be available.
Here's an example

DCLF FILE(FILE1) OPNID(ID1)
DCLF FILE(FILE2) OPNID(ID2)

RCVF: RCVF RCDFMT(FILE1) OPNID(ID1)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(XYZ))



GOTO RCVF

XYZ:
RCVF RCDFMT(FILE2) OPNID(ID2)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))

GOTO XYZ

END:
ENDPGM

Is This Answer Correct ?    25 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?

489


What is a record lock error?

1259


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

2367


What is file identifier where we can use?

639


How can we know running job is batch or interactive?

647






How can we override a file during runtime in rpg?

680


how do I play {insert rpg system here}?

579


How to call one program from another program in RPG? please help me with the code

1254


what is the procedure and explain about real time scenario.

1473


What is ment by record level identifier?

647


What is the difference between copybooks and subprocedures in as400?

801


Hi Viewers can any body explain me how to update and ahange the already existed data in physical file using subfile ? please explain me with the code if possible?

4198


how can I tell when to replace the array?

696


is this a rpg channel?

669


How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

546