what is the necessary command needed before OPNQRYF and why?

Answers were Sorted based on User's Feedback



what is the necessary command needed before OPNQRYF and why?..

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

what is the necessary command needed before OPNQRYF and why?..

Answer / kcsyam

OVRDBF with SHARE(*Yes) share the access path

Is This Answer Correct ?    17 Yes 3 No

what is the necessary command needed before OPNQRYF and why?..

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

what is the necessary command needed before OPNQRYF and why?..

Answer / surendra y mudliar

OVRDBF command

Is This Answer Correct ?    5 Yes 2 No

what is the necessary command needed before OPNQRYF and why?..

Answer / guddu

Can any one explain Why OVRDBF is mandatory? with out that
cant we execute OPNQRYF?

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More RPG400 Interview Questions

what is the difference between the procedure and module in ILERPG?

4 Answers  


Can a run time array be declare like below with no specified number of elements ? Is it possible ? DFLD_ARRAY 7 DIM() INZ(*blanks) What does this mean ? Does this mean that the number of array elements will be dynamically declared during run time ?

1 Answers   TCS,


Errors in Sql query will be in which state?

1 Answers  


what is the necessary keyword needed to scroll subfile records?

0 Answers   IBM,


can we perform CHAIN operation on Subfile record format....?

4 Answers  






If there are 1000 member(PGM type) in a SRC file. How can we compile in a CL program? ( It need to be done in a loop)?

1 Answers  


What are the commands that can be executed in CLP but not in RPG? Why?

1 Answers   CSC,


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,


How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

1 Answers  


1.I Have a physical file , i want to read the data from the each and every member of the File in the CL Program.How do you achieve this. 2.How do you do the same in RPG?. do think is it possible to read data from all the members in the RPG?

2 Answers   Cap Gemini,


Need a sql query: retrieve all duplicate records in table?

1 Answers  


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


Categories