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 ? | 26 Yes | 9 No |
Post New Answer View All Answers
how do I preserve and clean the array?
Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?
how can you display specific subfile page on the screen in unequal subfile?
When it is desirable to describe files Internally?
what is the procedure and explain about real time scenario.
What is the purpose of record level identifier?
how do I declare a table or array in rpg iv?
what is file information data structure?
what is kids-rpg?
explain sflclr, sflend, sfldlt, and sflcsrrrn?
what is the use of sflnxtchg?
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
How to select highest score of each subject or how to select highest income of every month?
what is an online rpg?
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?