• Subject: Re: Library a CLP is called from
  • From: Henrik Krebs <hkrebs@xxxxxxxxx>
  • Date: Thu, 30 Nov 2000 07:55:12 "GMT"

We had that discussion a while ago.

First: 'Good Practise' requires that you are normally not interested
in where a program is called from. It should always be called from
*LIBL
2'nd: There are always exceptions where you want to know it (e.g.:
Qualified Initial programs on a user profile).
3'rd: In the 2'nd case you can _not_ use RTVOBJD *LIBL/xxx and not
DSPOBJD *ALL/xxx. 

Here is the engenious solution that came up (not my solution - sorry
for forgetting whom to credit):

01.00 DCL &MSGDTA *CHAR 20
02.00
03.00 OVRDBF QPPGMDMP QSYS/QDAEDSP /* Arbitrary display file */
04.00 DMPCLPGM /* Will always fail with CPF0570 */
05.00 MONMSG CPF0570 EXEC(DO)
06.00   RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA)
07.00   SNDPGMMSG  MSGID(CPF9898) MSGF(QCPFMSG) +
08.00             MSGDTA('Program ' *CAT %SST(&MSGDTA 11 10) *TCAT '/'
+   
09.00                     *TCAT %SST(&MSGDTA 1 10) *BCAT 'is running')
+   
10.00             TOPGMQ(*EXT) /* Reporting name and library of
program */ 
11.00 ENDDO /* MONMSG CPF0570 */
12.00 DLTOVR QPPGMDMP

The idea is, that with the override in 03.00, DMPCLPGM will always
fail, and the exception message (CPF0570) has the library in it's
message data.
Remember to do the DLTOVR - otherwise you can never do a real dump in
later programs.

The statement 07.00 is just an example on how to display the
library/program. Normally you will do an 
  CHGVAR &xxx %SST(&MSGDTA 11 10) , 
then add the library to the library list, eventually do more
libl-setup so you can continue with 'Good Practise': calling program
via the library list.

Last: Steve, could you please turn off the html formatting in your
letter. David requires it (I guess) in his giudelines for this list, I
find it noisy and irritating and the net is overloaded by more than
100%. You really do not use this formatting facility for anything (and
if you did, it does not show up at many recipients). Tia.

Henrik 
http://hkrebs.dk 

---------------------------------------------------------
This mail was sent through Eoffice: http://www.eoffice.dk

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

This thread ...


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

This mailing list archive is Copyright 1997-2019 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].