Attempting to write a duplicate record on a subfile using RPGIV.

0 pts.
Tags:
RPG
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)
ASKED: February 8, 2005  4:39 PM
UPDATED: February 9, 2005  1:50 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

My first instinct would be to check that the SFLCLR is happening, that is you set on *IN50 and then do a WRITE ACCTCTL2 to clear it.

If possible could you post the RPG code so that we can see if there’s anything obvious in that.

All the best

Jonathan

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • JRMPGMR
    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
    0 pointsBadges:
    report
  • Dcrocker63
    Are you incrementing the relative record number for the second subfile when you write to it?
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following