Since the DMPCLPGM feature does not allow overriding the printer file QPPGMDMP to another file per CPF9850, the quoted CLP code probably could be simplified somewhat, by ridding of the DLTF processing. Even if the file QTEMP/NOTFOUND both exists and is sufficiently compatible with the expected QPPGMDMP PRTF to effect actual open processing, then the named-as overridden-to file still will not be used for a number of reasons, each of which should still fail with the expected CPF0570 and a preceding diagnostic; e.g. the CPF9850 because "QPPGMDMP"<>"NOTFOUND".

And FWiW, since the message data both available to and as extracted from the received CPF0570 is only 20 bytes, the 512 is overkill.

Regards, Chuck

On 07-Nov-2011 12:10 , Wyatt, Chris (FGWA-IL) wrote:
I've forgotten where I originally got this...

DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(512)
DCL VAR(&PGM) TYPE(*CHAR) LEN(10)
DCL VAR(&ORGLIB) TYPE(*CHAR) LEN(10)

DLTF FILE(QTEMP/NOTFOUND)
MONMSG MSGID(CPF2105) EXEC(DO)
RCVMSG MSGTYPE(*EXCP)
ENDDO
OVRDBF FILE(QPPGMDMP) TOFILE(QTEMP/NOTFOUND)
DMPCLPGM
MONMSG MSGID(CPF0570) EXEC(DO)
RCVMSG MSGTYPE(*DIAG)
RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA)
CHGVAR VAR(&PGM) VALUE(%SST(&MSGDTA 1 10))
CHGVAR VAR(&ORGLIB) VALUE(%SST(&MSGDTA 11 10))
ENDDO
DLTOVR FILE(QPPGMDMP)

<<SNIP>>

James Lampert on Monday, November 07, 2011 12:49 PM wrote:
Is there an easy way for a CL program to know what library it's
located in?

<<SNIP>>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.