|
I haven't needed to read a source file for about 24 years and didn't have
any problems reading them with OPM RPG.
Now I need to do it again and am using RPGLE. I can open the file and read
records but the fields are all empty. I must be doing something pretty
dumb. I am on V5R1. Can anyone help please? I have tried with both
externally described and program described files.
The code below is for the program described version
The file is defined in the program with
0001.10 FERPGLESRC IF F 112 DISK
0001.11 F USROPN
It is a full procedural file
The Input fields are
0248.39 IERPGLESRC DS
0248.40 I 1 6 2SRCSEQ
0248.41 I 7 12 SRCDAT
0248.42 I 13 112 SRCDTA
and the file statements are
0496.32 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * *
0496.33 C/SPACE
1
0496.34 C FNPEXT
BEGSR
0496.35 C/SPACE
1
0496.36 C Read ERPGLESRC
5152
0496.37 C/SPACE
1
0496.38 C
ENDSR
0496.39 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
0496.40 C/SPACE
1
0496.41 C FNP#1O
BEGSR
0496.42 C/SPACE
1
0496.43 * This subroutine opens the source
file
0496.44 C OPEN ERPGLESRC
51
0496.45 C MOVE 'Y'
OPNSRC
0497.08 C/SPACE
1
0497.09 C
ENDSR
0497.10 C/SPACE
1
0497.65 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
I then do an override before calling the program
OVRDBF FILE(ERPGLESRC) TOFILE(E290PRDSRC/QRPGLESRC) MBR(E29RPP)
POSITION(*START)
I do a debug after the read statement and all the fields are empty but the
correct file member is open - I have checked the job using WRKACTJOB
I shall probably be embarrassed by the simplicity of the answer
Many thanks.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.