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
can I touch the array during treatments?
Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg
what are the key words you must use when using a subfile?
what is data area and how it is used in rpg program ?
what is *place and *auto keyword in prtf ?plz explain
how do I declare a table or array in rpg iv?
what is the necessary keyword needed to scroll subfile records?
When it is desirable to describe files Internally?
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
Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?
are there any useful c runtime apis that I can call from rpg iv?
How can we override a file during runtime in rpg?
How to call one program from another program in RPG? please help me with the code
What is difference between bind by copy and bind by reference?
what is kids-rpg?