ExtDesc is only used at compile time, not at run time. ExtFile is used at Run Time.
Have you tried writing to the File name instead of the Format name?
Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Monday, June 16, 2014 4:32 PM
To: RPG programming on the IBM i / System i
Subject: Weirdness with EXTDESC, EXTFILE, EXTMBR, and a CPF5152
I have a situation that's producing CPF5152s (but NOT consistently) when preparing a source member to pass to the EMLMSG command in Giovanni Perotti's MimeMail (MMAIL).
Here's a simplified source:
FMIMEBODY O E DISK USROPN EXTDESC('MERCURY/QCLSRC')
F EXTFILE('QTEMP/MIMEBODY')
F EXTMBR('DFT')
D CRTMIMEBODY S 32A INZ('CRTSRCPF QTEMP/MIMEBODY +
D MBR(DFT)')
C CALL 'QCMDEXC'
C PARM CRTMIMEBODY
C PARM 32 CMDLEN 15 5
C OPEN MIMEBODY
C EVAL SRCDTA = 'Scheduled Activity Information'
C WRITE QCLSRC
C SETON LR
It seems that in the real program, a WRITE QCLSRC will, for no apparent reason, and after several successful WRITE QCLSRC statements were already executed (otherwise it wouldn't have gotten that far), it will throw a CPF5152.
Message . . . . : Record format QCLSRC not in member DFT.
Cause . . . . . : The record format name, QCLSRC, that was specified on the
get interface is not in member DFT file MIMEBODY in library QTEMP.
Recovery . . . : Specify the name of a record format that is used by member
DFT and try your request again.
And it does NOT do it consistently. Most of the time, it works just
fine: it builds the message in a source member, passes it to MMAIL/EMLMSG, and sends off the email.
Clearly, the record format name to use on the WRITE statement is the one from the file named on the EXTDESC; were I to use the actual format name, it wouldn't compile (probably in part because for some reason, IBM decided that source PFs would have the same name for both filename and record format name).
Anybody have any ideas what could be happening?
--
JHHL
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.