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?
What is the difference between iter and do?
Please tell me how to read the records from a file with load an array of size with error conditions(The logic answer for this question is ARR is array of 99 elements Z-ADD 0 IDX *LOVAL SETLL FILE READ FILE 99 *IN99 DOWEQ *OFF IDX ANDLT 99 ADD 1 IDX MOVE FIELD ARR,IDX READ FILE 99 ENDDO).So,Please give me the complete of this code.
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 to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...
How to handle duplicate error handling in RPG?
1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.
can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.
How would display prime numbers using CL program?
can you debug ile rpg program using isdb?
what is an online rpg?
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 do I declare a table or array in rpg iv?
We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?