I am scratching my head trying to solve this issue.
I have a two subfiles. Basically what i'm trying to achieve is to select a record from the subfile with an option.
This will then call another program which is basically a copy of the previous program.
What im trying to achieve. Select the record I want and then call the next program which will display all the current records and omit the read record.
Refer to image below to see the subfile display First Subfile
Currently if I enter the second program it will enter an unspecified error as it reads the LF file at the last record.
The two programs are using the same LF file which is pointing to the same PF and also the same SDA subfile. The two programs are basically identicals but I've set conditions to omit it based on the accnumber. When that didnt work i tried using a counter which is the previous programs RRN. That didn't work as well. I'm at wits end right now.
FACCDLF5 UF A E K DISK
FSDAFUND CF E WORKSTN
This is my file declaration
C PARMCUSTID CHAIN(N) ACCDLF5
C IF %FOUND()
C PARMCUSTID DOWEQ QCUSTCHK
C EXSR FETCH1
C ADD 1 RRN
C MOVE RRN RRN2
C WRITE DTLTTEL
C FETCH1 BEGSR
C MOVE ACCNUMBER SACCNUM1
C READ ACCDLF5
C MOVE CUSTID QCUSTCHK
C ENDSR
Is there something im missing. If i do another solution By Passing the Parm of the RRN over to the second program Subsequently doing a code as shown below before performing the fetch it works, however it omits one record. Doing the original code as the previous program will encounter an error.
C* RRN2 SUB 1 RRN2
C IF %FOUND()
C RRN DOUEQ RRN2
Anyone know why that is.. The chain is not locking the PF file... Its been 2 hours debugging and using every method i know at hand.