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
…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
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
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
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
…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
Just Update record in physical file and try