Error in subfile programming

635 pts.
Tags:
AS/400 Subfiles
AS/400-Subfile Programming
AS400 Subfile
OS/400
I am encountering a very annoying problem. I have a subfile program and i am writing both SFL and SFLCTL and then reading the subfile. But as soon as the my code read the subfile READ D123, it gives me an error saying "Session or device error occurred in file D123" and then in DUMP it says Message Identifier . . . . . . . . . . :   CPF5053              A record name is required.           Anybody with the solution. Thanks

Software/Hardware used:
os/400
ASKED: February 9, 2011  5:19 PM
UPDATED: February 10, 2011  11:04 PM

Answer Wiki

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

I would compare the code in this program with another one of yours that has a working subfile.
The main things I would compare are:
o What is the sequnece of my WRITE, READ, READC, EXFMT instrucitons
o What indicators are on/off when these are happing.
Sometimes I copy an the source form an old DSPF and use it with code I copied from a newer RPG program and I have problems. The “Standards” changed over time as to what indicatiors I use in the DSPF for conditioning the SFLxxx keywords.

Discuss This Question: 7  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
  • TomLiotta
    ...read the subfile READ D123, it gives me an error saying "Session or device error occurred in file D123" According to what you wrote, you are issuing your READ statement against the file -- D123. The error message is CPF5053 which means "A record name is required." You need to READ the subfile record name instead of the file name. You can't READ D123. Tom
    125,585 pointsBadges:
    report
  • Sangay
    but when i gove subfile record name (RECSFL) it gives me an error " e READ Operation entry is invalid for the Subfile-Record format. Specification ignored
    635 pointsBadges:
    report
  • Sangay
    DDS is as follows:- A DSPSIZ(24 80 *DS3) A R RECSFL SFL A 30 SFLNXTCHG A UPC 20 B 8 3TEXT('UPC 2ND ITEM' A 31 DSPATR(UL) A* A R RECCTL SFLCTL(RECSFL) A* A SFLSIZ(0010) A SFLPAG(0005) A 10 SFLDSP A 10 SFLDSPCTL A N10 SFLCLR A SFLDROP(CF04) A SFLFOLD(CF04) A 5 3'UPC SHORT CODE. .' A COLOR(WHT) A UPCSCD 3A I 5 24TEXT('UPC') RPG FD123 CF E WORKSTN INFDS(@D123) F SFILE(RECSFL:I1) C READ RECCTL C *ENTRY PLIST C PARM PADDNO 8 * C S999 BEGSR * C SETOFF 3110 C Z-ADD 0 I1 4 0 C Z-ADD 5 PG 4 0 * C WRITE RECCTL C DO PG C ADD 1 I1 C WRITE RECSFL C ENDDO C SETON 1031 C MOVEL '111' UPCSCD C ENDSR
    635 pointsBadges:
    report
  • TomLiotta
    Is that the entire RPG program or only pieces of it? It looks like the only thing the program does is attempt to read the RECCTL control record. The subroutine that generates the subfile rows is not executed anywhere that I can see. Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    ...READ Operation entry is invalid for the Subfile-Record... Yes, that's exactly correct. The actual input operation code should be either a CHAIN by relative record number or READC to get the next changed subfile record. But note that neither op-code can actually run until after the subfile is built. Tom
    125,585 pointsBadges:
    report
  • Sangay
    [...] CharlieBrowne and TomLiotta collaborate to remedy the error in subfile programming that Sangay’s been receiving. 6. Rechil and Mrdenny are in the process of helping a member [...]
    0 pointsBadges:
    report
  • SURYAP
    Just Update record in physical file and try
    300 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