OPNQRYF and OVRDBF

skorek

Well Known Member
Hi JDE-guys

I have a little problem with these two CL commands.
Situation is following:
In CLP-A I have code:

OVRDBF FILE(F4211LA) OVRSCOPE(*CALLLVL) SHARE(*YES) OPNSCOPE(*ACTGRPDFN)
/*
CALL PGM(PH98315) PARM(&PSPID &PSVERS &PSFIL1 +
&PSMSGQ)

PH98315 - it is my version of P98315, it creates query on
file from PSFIL1, in this case it is F4211LA (logical) (not for base DW file)

Then I call RPG-A with declaration:

FF4211LA UF E K DISK

and in F4211LA I have acces only to record with selection from query. No
problem.

Then RPG-A call CLP-B with code:
OVRDBF FILE(F4211I) TOFILE(F4211LA)

and then CLP-B call RPG-B where F4211I is declared:
FF4211I UF E K DISK

But when I try read any record from file F4211I, program can't find any
records.

Why?
Have you any idea?
What I wrote wrong?

Regards

Tomasz Skorza
 
following:In CLP-A I have code: OVRDBF FILE(F4211LA)
OVRSCOPE(*CALLLVL) SHARE(*YES) OPNSCOPE(*ACTGRPDFN)/* CALL
PGM(PH98315) PARM(&PSPID &PSVERS &PSFIL1 +
&PSMSGQ)PH98315 - it is my version of P98315, it creates query onfile from
PSFIL1, in this case it is F4211LA (logical) (not for base DW file)Then I
call RPG-A with declaration:FF4211LA UF E K DISKand in
F4211LA I have acces only to record with selection from query.
Noproblem.Then RPG-A call CLP-B with code: OVRDBF
FILE(F4211I) TOFILE(F4211LA)and then CLP-B call RPG-B where F4211I is
declared:FF4211I UF E K DISKBut when I try read any
record from file F4211I, program can't find anyrecords.Why?Have you any
idea?What I wrote wrong?RegardsTomasz Skorza


Tomasz -
If you are working with JDE, you need to learn more about the way JDE does
things. Otherwise you're going to write a lot of code that is unnecessary.
The CD-ROM documentation has a section with technical documentation
(Technical Foundation) about DreamWriter that explains the concepts.

You need to look at what JDE does to reposition the file _after_ it has been
processed in an RPG program. You call J81OQ to reposition the file pointer
in order to reprocess the file. Look at J42520 for an example of how to
call this program.

Then your program RPG-B will have successfully be able process the
OPNQRYF-created file _again_.

HTH
Steve Landess
Austin, Texas
(512) 423-0935



Steve Landess
V4R4 A7.3 cume9
EDI
(512) 423-0935
 
Okay,

I am not sure at what point the CLP-B is called but if it is called at the end of the read cycle of F4211LA than what you need to do in your second CL, you need to call another JDE CL which is called J810Q. This CL reset the opnqryf pointer and you will be able to read from the same filtered file again.

Hope this helps.

Naveed
--

Senior Consultant
M&D Information Systems
847 477 0812
 
In your second program you overide LI to the LA file. The LA file is the OPNQRYF which probably doesn't allow reading the records for update.
Are you intending to read the opnqryf in pgm 2 if so go into the DW and set it to allow reading for update.
Another possibility would be pgm 1 has read the records and the opnqryf is now at EOF. In this case you would need to reposition the file back to the start before the call to the second program.
Why are you overiding LI to LA in the second program?


skorek <[email protected]> wrote:
Hi JDE-guysI have a little problem with these two CL commands.Situation is following:In CLP-A I have code: OVRDBF FILE(F4211LA) OVRSCOPE(*CALLLVL) SHARE(*YES) OPNSCOPE(*ACTGRPDFN)/* CALL PGM(PH98315) PARM(&PSPID &PSVERS &PSFIL1 + &PSMSGQ)PH98315 - it is my version of P98315, it creates query onfile from PSFIL1, in this case it is F4211LA (logical) (not for base DW file)Then I call RPG-A with declaration:FF4211LA UF E K DISKand in F4211LA I have acces only to record with selection from query. Noproblem.Then RPG-A call CLP-B with code: OVRDBF FILE(F4211I) TOFILE(F4211LA)and then CLP-B call RPG-B where F4211I is declared:FF4211I UF E K DISKBut when I try read any record from file F4211I, program can't find anyrecords.Why?Have you any idea?What I wrote wrong?RegardsTomasz Skorza
To view this thread, go to:
http://www.jdelist.com/ubb/showthreaded.php?Cat=&Board=W&Number=55273
+ - - - - - - - - - - - - - - - - - - - - - - - -+
This is the JDEList World™ mailing list/forum.
Archives and information on how to SUBSCRIBE, and
UNSUBSCRIBE can be found on the JDEList Forum at
http://www.JDEList.com

JDEList is not affiliated with JDEdwards®

+ - - - - - - - - - - - - - - - - - - - - - - - -+

---------------------------------
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
 
Back
Top