Based on file and RPG.

lutesk

Member
Can a DW based on file be reopened in RPG successfully? I'm trying to close and then reopen the F4211, but the read is turning on LR after the reopen. Does this have something to do with the ODP or job scope?
Anyone ever tried this? I've never had trouble closing and reopening non-based on files.

Thanks.
 
Never tried to do that, but I think is impossible because the override and OPNQRYF in the CL Program =0A=0A=0A
 
That may be a good question to pose to JDE Support. I have never tried
doing that. What JDE is really doing in the dream writer most of the
time is 1) Doing an OVRDBF, share *Yes, 2) Doing an OPNQRYF, and then
when the program is done, doing a 1) CLOF, and 2) DLTOVR. Maybe instead
of doing the OPNQRYF option in the dream writer (which is the default),
you may wish to try specifying using a temporary logical file and see if
that will work.

Have not paid attention to how JDE structures the OVRDBF and OPNQRYF
commands. Could be something in there that creates your issue, but just
do not know.

John Dickey
Financial Systems Administrator
White-Rodgers, division of Emerson Electric
8100 West Florissant Ave.
P.O. Box 36922
St. Louis, MO 63136-9022
314-553-3067
[email protected]
 
This depends on whether the CL program is doing the open or open query
file on the F4211. If the open in handled in the RPG with an open, then
I believe you can do it with no problem.

Jim
 
In your RPG, you may need to use a logical file over the database file that JDE is building the dream writer over.

I do this all the time. Use the database file. The Dream Writer will build the open query over it, then in the program, you can get the records you want with a logical over the data base file.

The primary file in the RPG program has to be the based on file in the Dream Writer.

Hope this helps.

/lf
 
Also, the F4211 should be user control open in your RPG program.

/lf
 
I got it to work with help from Bernard. He suggested using the POSDBF command, so here's what I did:


** Table for command to position dat
POSDBF OPNID(F4211) POSITION(*START)

C SETOF LR
C CLOSEF4211
C Z-ADD36 PSLEN 155
C CALL 'QCMDEXC'
C* ---- ---------
C PARM @POS
C PARM PSLEN
C OPEN F4211


Worked like a charm. Thanks to all, and especially Bernard.
 
There is a JDE function that does this. The following logic will reposition the OPNQRYF. Why do you need to close the file?


C MOVE *BLANKS PSFILE 10
C MOVEL'F4211 'PSFILE
C MOVE ' ' PSERR 1
C CALL 'J81OQ'
C PARM PSFILE
C PARM PSERR
C PSERR IFEQ '1'
C SETON LR
C GOTO EOJ
C*
 
Back
Top