× 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.



On Wed, May 26, 2021 at 3:44 PM Mark Waterbury <
mark.s.waterbury@xxxxxxxxxxxxx> wrote:



Steve,

See:
https://www.ibm.com/docs/en/i/7.1?topic=ssw_ibm_i_71/apis/concept7.htm


See also:
https://www.ibm.com/docs/en/i/7.2?topic=ssw_ibm_i_72/apis/QMHSNDSM.htm

The "scope message" API goes all the way back to V2R1 ... ;-)


QMHSNDSM is answer. Thanks Mark.

here is some sample code.
/* demo use of QMHSNDSM - send scope message API. */
PGM

DCL VAR(&SCOPETYPE) TYPE(*CHAR) LEN(10)
dcl &qualPgm *char 20
dcl &scopeData *char 256
dcl &dataLx *int 4
dcl &msgkey *char 4
dcl &ec *char 516
dcl &ec_prov *int stg(*defined) len(4) defvar(&ec 1)

dcl &ec_avail *int stg(*defined) len(4) defvar(&ec 5)

dcl &ec_excp *char stg(*defined) len(7) defvar(&ec 9)

dcl &ec_data *char stg(*defined) len(500) defvar(&ec
17)

/* use QMHSNDSM API to have the system call TEST00062C when this program
ends. */
chgvar &ec_prov 0
chgvar &scopeType '*PGM'
chgvar &scopeData 'TEST0006DA'
chgvar &dataLx 10
chgvar &qualPgm 'TEST00062C*LIBL'
call qmhsndsm parm(&scopeType &qualPgm &scopeData
&dataLx +
&msgkey &ec )

/* alloc the dtaara. The scope program TEST00062C will run when this
program ends */
/* TEST00062C will deallocate the dtaara.
*/
ALCOBJ OBJ((TEST0006DA *DTAARA *EXCLRD)) WAIT(0)

ENDPGM

/* scope program. This program specified in the call to QMHSNDSM. This
program */
/* is called when the program which calls QMHSNDSM exits ( goes out of
scope. ) */
PGM (&data)
dcl &data *char 500
dcl &dtaara *char 10

chgvar &dtaara %sst(&data 1 10)
SNDPGMMSG MSG('scope pgm called. data:' *CAT &DTAARA)
DLCOBJ OBJ((&DTAARA *DTAARA *EXCLRD))

endpgm

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.