× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Eric,

<snip>
I am using the QMHSNDPM program to send error messages. How do I pass the substitution parameters to it for &object, &library and
&type (in this case it is for CPF9801)?
</snip>

I'm guessing your subject line is incorrect and you want to pass substitution variables to QMHSNDPM and not CEEDOD. Here is a working example I put together for using QMHSNDPM:

h OPTION(*SRCSTMT:*NODEBUGIO) INDENT('| ')

* *ENTRY procedure...
d TESTMSG pr extpgm('TESTMSG')
d TESTMSG pi

* Send message...
d QMHSNDPM pr extpgm('QMHSNDPM')
d msgID 7a const
d msgf 20a const
d msgData 256a const
d msgDataLen 10i 0 const
d msgType 10a const
d callStakEntry 10a const
d callStakCount 10i 0 const
d msgKey 4a const
d ErrorCode 32767a options(*varsize)
d callStakLen 10i 0 const options(*nopass)
d callStakQual 20a const options(*nopass)
d dspMsgWaitTim 10i 0 const options(*nopass)
d callStakDataT 10a const options(*nopass)
d ccsid 10i 0 const options(*nopass)

* Error Code DS...
d ErrorCode ds qualified
d BytesProv 10i 0 inz(0)
d BytesAvail 10i 0 inz(0)
d ExcpID 7a
d 1a
d ExcpData *
d ErrorData s 100a based(ErrorCode.ExcpData)

* General workfields...
d msgkey s 4a inz(X'00000000')
d var s 27a

// Doing a DSPMSGD on CPF9801 gives the following..:
// Message Text: Object &2 in library &3 not found.
// Message variables...
// Field Data Type Length
// &1 *CHAR 0
// &2 *CHAR 10
// &3 *CHAR 10
// &4 *CHAR 0
// &5 *CHAR 7

// We want to set variables &2 and &3 and &5...
c eval var = 'MYFILE MYLIB MYTYPE'

// Send a diagnostic message to this program...
c eval ErrorCode.BytesProv = %size(ErrorData)
c callp QMHSNDPM('CPF9801' :'QCPFMSG *LIBL'
c :var :%len(var) :'*DIAG'
c :'*' :0 :msgKey :ErrorCode)

// A diagnostioc message should have been sent, and will be found in the job log.
// The text of the message in the job log is: Object MYLIB in library MYFILE not found.
// With additional text of:
// Cause . . . . . : The object MYFILE in library MYLIB type *MYTYPE not found.
// The object name, library name, or the object type is not correct. If the
// library name is not specified, the object may be in a library that is not
// contained in the library list.

c eval *inlr = *on
c return

HTH

Cheers

Larry Ducie



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.