what is the necessary command needed before OPNQRYF and why?
Answers were Sorted based on User's Feedback
Answer / abhishek bajpai
It is not mandatory to use OVRDBF(*Yes) before OPNQRYF. You
can still use OPNQRYF without OVRDBF.
But here the pupose of the OPNQRYF won't be solved.
Opnqryf creates its own Open data path and to share the
same data path in a program we use ovrdbf share(*yes), if
we do not use ovrdbf, then program will have its own ODP,
so it will read the file from begining on which query has
been run. So, OPNQRYF selected records will have no
importance.
So, we need to use CPYFRMQRYF command and put the selected
records in to runtime file and use that file to read in
program.
| Is This Answer Correct ? | 20 Yes | 2 No |
Answer / sumit gupta
Hi guddu............
OVRDBF is not mandatory before doing OPNQRYF. OVRDBF is
only used to share the open data path within the calling
program(i.e we can use the selected records from OPNQRYF in
further program whose call is being made after
OVRDBF+OPNQRYF).
But is we dont use the OVRDBF command then open data path
will not be shared and if we done the RCVF on that file
after OPNQRYF(WITHOUT OVRDBF) then the selected records
from OPNQRYF will not be used and this RCVF will process
all the records from that file.
OVRDBF command is used just to share the open data path (By
specifying SHARE(*YES).
We we want to use the selected records from the OPNQRYF in
our further programs which call after this CL then we can
use CPYFRMQRYF command to copy all the selected records
from this OPNQRYF and then RCVF on this new file(which has
got generated by CPYFRMQRYF).
| Is This Answer Correct ? | 11 Yes | 2 No |
i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.
As Packed veriable store 2 digits in 1 byte and ZONE variable store 1 digit in 1 byte... Please tell me when we have to use Packed and Zone variable...?
Hi, can any one tell me :IN CASE OF SINGLE PAGE FILE HOW WILL I LOAD THE PREVIOUS PAGE WITHOUT THE USE OF SFLCLR INDICATOR ?
purpose of pannel group??/
How to index LF by relative record no (RRN)
I have a RPG program of 100 Lines and first line is to SETON indicator LR. Will the program execute rest of the 99 Lines?
The RP program is displaying records 11 times .But there are 10 records in a pf.(ie last record is displayed twice).How to display records only 10 times?
1.How to read a subfile in out put mode? 2.what are the keywords used to share same file? 3.using composite key which rpg code used?
is this a rpg channel?
can i use UPDDTA command in rpg program in which contains a file
How do I link an existing logical file to it's Physical File without recompiling?
What hapens when we use CPYF command to copy a LF? On which PF will it be dependent???