I have created a subfile that contains up to 10 records. If the user puts a D beside one or more records, I bring up a second control record and subfile. I window a ?are you sure message?. If the user chooses yes or no, I still want to go back and read the 1st subfile for anymore D?s. Then pull up the second control record and subfile again with different data. When I try to write to the 2nd subfile for the second time, I am getting an error, ?attempting to write a duplicate record on the 2nd subfile.
During debug, I checked the data in the 2nd subfile, 1st time around and it was correct and displayed. I check and data after clearing and all of the subfile fields were cleared. (seton SFLCLR and even moved zero?s or blanks to the fields, and ERASEINP(*ALL) I checked the data the second time around on the 2nd subfile prior to writing and the data appears to be correct. The RRN was reset.
After 1 week of frustration and work, would someone please see if they can figure out this mess.
Thank you
DELCTL1
ENTER MEMBER NUMBER: 99999-
PLACE A (D) IN THE OPTION COLUMN/S TO SELECT
OPTION AGREEMENT NBR ACCOUNT NBR
DELSF (Subfile1)
B 666666 - 66 66666
B 666666 - 66 66666
B 666666 - 66 66666
B 666666 - 66 66666
B 666666 - 66 66666
ACCCTL1
MEMBER #: 99999- AGREEMENT #: 999999- - 99 CONTR DATE: 99/99/99
MEMBER NAME 1-2: OOOOOOOOOOOOOOOOOOOOOOOOOOOOO ?
OOOOOOOOOOOOOOOOOOOOOOOOOO
BIN LOCATION: BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
ACCT #: 99999- ST/CNTY/FARM#: 99- 999- 999999- BIN #: BB
GRADE: B VARIETY: BB MILLING YIELD: 99.9-99.9 CERT #: 99999-
PRM EST BUSHELS: 9999999.99
FSA EST BUSHELS: 9999999.99
90% FSA EST BUSH: 9999999.99
ACCTSF (Subfile 2)
MEMBER NAME: OOOOOOOOOOOOOOOOOOOOOOOOOOOOO
MEM DIVISION BUSHELS NBR OF BUSHELS/POOL CONTRACT #
NBR PERCENT PER MEM RG PR IF PRICED
66666 66.666 6666666.66 9999999.99 9999999.99 999999-
MEMBER NAME: OOOOOOOOOOOOOOOOOOOOOOOOOOOOO
MEM DIVISION BUSHELS NBR OF BUSHELS/POOL CONTRACT #
NBR PERCENT PER MEM RG PR IF PRICED
66666 66.666 6666666.66 9999999.99 9999999.99 999999-
A R ACCTCTL2 SFLCTL(ACCTSF)
A*%%TS SD 20050207 160220 ******* REL-V5R1M0 5722-WDS
A TEXT('ACCT#CTL')
A 25 OVERLAY
A 50 ERASEINP(*ALL)
A 25 SFLDSP
A 20 SFLDSPCTL
A 50 SFLCLR
A 25 SFLEND(*MORE)
A SFLSIZ(0020)
A SFLPAG(0002)
Software/Hardware used:
ASKED:
February 8, 2005 4:39 PM
UPDATED:
February 9, 2005 1:50 PM
I agree that we need to see the RPG code.
As a point of programming style, you might want to change the indicator on the SFLDSPCTL to the negative of the SFLCLR indicator. You then have a boolean condition where writing the control record is either to clear the subfile, or to display the control record.
Richard
Are you incrementing the relative record number for the second subfile when you write to it?