How I can reread the physical file in CL program once the
end of file reached in same CL program.
Answers were Sorted based on User's Feedback
Answer / naga srinivas.kattula
Why u need POSDBF? whether u are checking the record in
first file is in second file?
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / ravikumar
Hi,
we can read this file from end of file now.
but once the cursor reached at the end of file then we can not read it again.
DCLF FILE(FILE NAME) OPNID(E)
POSDBF OPNID(File Name) POSITION(*END)
READ: RCVF OPNID(E)
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END))
OPERATIONS
GOTO CMDLBL(READ)
END: ENDPGM
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / tthomas
Once the file reaches EOF the file is close.POSDBF wont
work in this case. To be clear no file operations can be
done on the file.
Upto 5 files can be declared in V5R3 with different OPEN
ID's.So u can declare the same file 5 times if u want and
perform different operations until the file reaches EOF.
Hope this info will be sufficient.
| Is This Answer Correct ? | 4 Yes | 5 No |
In V5R4M0 , we can declare 5 files in CL-ILE pgm
DCLF (FILE1) OPENID(OP1_)
DCLF (FILE2) OPENID(OP2_)
DCLF (FILE3) OPENID(OP3_)
DCLF (FILE4) OPENID(OP4_)
DCLF (FILE5) OPENID(OP5_)
DCL &LGL *LGL VALUE('1')
DOWHILE (&LGL = '1')
RCVF (RCDFMT_FILE1)
MONMSG MSGID(CPF0864) EXEC(LEAVE)
OPERATIONS
ENDDO
SIMILAR TO ALL 4 FILES....
| Is This Answer Correct ? | 4 Yes | 5 No |
Answer / jp
Answer no. #11 is correct. Thanks Abhishek. NOthing else
works.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / abhishek bajpai
Hi All,
Please read the question first. It asks the method to re-
position/re-read the file again after it reached EOF in a
CL. Please dont post answers to prevent it from reaching
EOF :).
Also, u can use a single keyword CLOSE for the same as
described above by me.
Thanks
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / siddhartha
Use POSDBF OPNID(File Name) POSITION(*START) to position
the cursor to the beginning of the file.
| Is This Answer Correct ? | 11 Yes | 20 No |
Answer / skma
I think it can be done by using OVRDBF
Like
OVRDBF FILE(FILE1) POSITION(*START)
Thanks
| Is This Answer Correct ? | 1 Yes | 12 No |
How do you know if a record exists without doing a READ and CHAIN?
1. Which Built-In-Function will you use to achieve the following functionality? CLONO1NO2NO3 Factorl÷÷+OpcdeFactor2++÷ResultLenDHHiLoEq C QTY IFLT *ZERO C QTY MULT -1 QTY C ENDIF a) %ABS b) %TRIM c) %TRIMS d) %UNS
Let?s consider a variable X of length 20. Move value ?ABC? to it.How to determine how many characters does X have?
1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?
Is it possible to call a subfile using CL. IF yes.. kindly help me out with explanation...?
what is edit word and edit code
wat is the difference between dataarea and data queue?
5 Answers Airtel, Four soft, Shahi Exports,
i 'm new to as/400.in an interview i was asked this question.give a practical example for passing information or data through local data area. I know only that data area is an object used to store tiny bits of data or it can store one value at a time and it is used to store frequently changing values or datas.thats all i know about data area can any one tell me how local data area and user defined data area are used to pass data between jobs with a example or coding.thanks in advance.
1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG? 4) How to find the attributes for subfiles? and what is the DDS for subfiles?
Interviewer asked me write down DDS for load all subfile .can anybody write dds
What is the difference between iter and do?
How do you find out whether a record is present in the physical file without reading the file? for Example Employee No: 100 in an Employee master.How do we find out whther 100 is present in Employee master without reading the file?
11 Answers Bank Of America, CSC, IBM,