97 lines
5.7 KiB
HTML
97 lines
5.7 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="reference" />
|
||
|
<meta name="DC.Title" content="Example: Send last diagnostic message as an escape message" />
|
||
|
<meta name="abstract" content="This example is a program that sends the last diagnostic message as an escape message." />
|
||
|
<meta name="description" content="This example is a program that sends the last diagnostic message as an escape message." />
|
||
|
<meta name="DC.subject" content="example, sample default message program" />
|
||
|
<meta name="keywords" content="example, sample default message program" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="esmsg.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1998, 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="exdfp" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Example: Send last diagnostic message as an escape message</title>
|
||
|
</head>
|
||
|
<body id="exdfp"><a name="exdfp"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Example: Send last diagnostic message as an escape message</h1>
|
||
|
<div><p>This example is a program that sends the last diagnostic message
|
||
|
as an escape message.</p>
|
||
|
<div class="section"><p>The following program is a sample default program that could be
|
||
|
used when a diagnostic message is sent followed by an escape message. This
|
||
|
program could be an OPM CL program or an ILE program that has this single
|
||
|
CL procedure. </p>
|
||
|
<pre> PGM PARM(&MSGQ &MRK)
|
||
|
DCL VAR(&MRK) TYPE(*CHAR) LEN(4)
|
||
|
DCL VAR(&MSGQ) TYPE(*CHAR) LEN(6381)
|
||
|
DCL VAR(&QNAME) TYPE(*CHAR) LEN(4096)
|
||
|
DCL VAR(&MODNAME) TYPE(*CHAR) LEN(10)
|
||
|
DCL VAR(&BPGMNAME) TYPE(*CHAR) LEN(10)
|
||
|
DCL VAR(&BLANKMRK) TYPE(*CHAR) LEN(4) VALUE(' ')
|
||
|
DCL VAR(&DIAGMRK) TYPE(*CHAR) LEN(4) VALUE(' ')
|
||
|
DCL VAR(&SAVEMRK) TYPE(*CHAR) LEN(4)
|
||
|
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
|
||
|
DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(100)
|
||
|
DCL VAR(&MSGF) TYPE(*CHAR) LEN(10)
|
||
|
DCL VAR(&MSGLIB) TYPE(*CHAR) LEN(10)
|
||
|
DCL VAR(&OFFSET) TYPE(*DEC)
|
||
|
DCL VAR(&LENGTH) TYPE(*DEC)
|
||
|
|
||
|
/* Check for OPM program type */
|
||
|
|
||
|
IF (%SST(&MSGQ 277 1) *EQ '0') THEN(DO)
|
||
|
CHGVAR VAR(&QNAME) VALUE(%SST(&MSGQ 1 10))
|
||
|
CHGVAR VAR(&MODNAME) VALUE('*NONE')
|
||
|
CHGVAR VAR(&BPGMNAME) VALUE('*NONE')
|
||
|
ENDDO
|
||
|
ELSE DO
|
||
|
/* Not an OPM program; always use the long procedure name */
|
||
|
<span>CHGVAR VAR(&OFFSET) VALUE(%BIN(&MSGQ 281 4))</span>
|
||
|
CHGVAR VAR(&LENGTH) VALUE(%BIN(&MSGQ 285 4))
|
||
|
CHGVAR VAR(&QNAME) VALUE(%SST(&MSGQ &OFFSET &LENGTH))
|
||
|
CHGVAR VAR(&MODNAME) VALUE(%SST(&MSGQ 11 10))
|
||
|
CHGVAR VAR(&BPGMNAME) VALUE(%SST(&MSGQ 1 10))
|
||
|
ENDDO
|
||
|
GETNEXTMSG: CHGVAR VAR(&SAVEMRK) VALUE(&DIAGMRK)
|
||
|
RCVMSG PGMQ(*SAME (&QNAME &MODNAME &BPGMNAME)) +
|
||
|
MSGTYPE(*DIAG) RMV(*NO) KEYVAR(&DIAGMRK)
|
||
|
IF (&DIAGMRK *NE &BLANKMRK) THEN(GOTO GETNEXTMSG)
|
||
|
ELSE IF (&SAVEMRK *NE ' ') THEN(DO)
|
||
|
/* If no diag message is sent, no message is sent to the previous program */
|
||
|
RCVMSG PGMQ(*SAME (&QNAME &MODNAME &BPGMNAME)) +
|
||
|
MSGKEY(&SAVEMRK) RMV(*NO) MSGDTA(&MSGDTA) +
|
||
|
MSGID(&MSGID) MSGF(&MSGF) MSGFLIB(&MSGLIB)
|
||
|
SNDPGMMSG MSGID(&MSGID) MSGF(&MSGLIB/&MSGF) +
|
||
|
MSGDTA(&MSGDTA) TOPGMQ(*PRV (&QNAME +
|
||
|
&MODNAME &BPGMNAME))
|
||
|
MSGTYPE(*ESCAPE)
|
||
|
ENDDO
|
||
|
ENDPGM</pre>
|
||
|
</div>
|
||
|
<div class="section"><p>The program receives all the diagnostic messages in FIFO order.
|
||
|
Then it sends the last diagnostic message as an escape message to allow the
|
||
|
previous program to monitor for it.</p>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="esmsg.htm" title="For each message you create that can be sent as an escape message, you can set up a default message handling action to be used if the message, when sent, is not handled any other way.">Specify default message handling for escape messages</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|