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
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?
What is a record lock error?
1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?
What is file identifier where we can use?
How can we know running job is batch or interactive?
How can we override a file during runtime in rpg?
how do I play {insert rpg system here}?
How to call one program from another program in RPG? please help me with the code
what is the procedure and explain about real time scenario.
What is ment by record level identifier?
What is the difference between copybooks and subprocedures in as400?
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?
how can I tell when to replace the array?
is this a rpg channel?
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