128 lines
7.9 KiB
HTML
128 lines
7.9 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: Watch exit program" />
|
|
<meta name="abstract" content="This is sample code for a watch trace exit program. It is written in control language (CL)." />
|
|
<meta name="description" content="This is sample code for a watch trace exit program. It is written in control language (CL)." />
|
|
<meta name="DC.Relation" scheme="URI" content="rzakuwatchexitpgmandexample.htm" />
|
|
<meta name="DC.Relation" scheme="URI" content="rzakuextendwatchexitpgm.htm" />
|
|
<meta name="copyright" content="(C) Copyright IBM Corporation 1997, 2006" />
|
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 1997, 2006" />
|
|
<meta name="DC.Format" content="XHTML" />
|
|
<meta name="DC.Identifier" content="exitprogramexample" />
|
|
<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: Watch exit program</title>
|
|
</head>
|
|
<body id="exitprogramexample"><a name="exitprogramexample"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Watch exit program</h1>
|
|
<div><p><span>This is sample code for a watch trace exit
|
|
program. It is written in control language (CL).</span></p>
|
|
<div class="section"><div class="p">Use this exit program as a starting point to help you create your
|
|
own watch trace program. You can modify the code to allow the program to perform
|
|
additional function. Find out how you can <a href="rzakuextendwatchexitpgm.htm#extendwatchexitpgm">extend
|
|
the capability of the watch function</a> using the watch exit program example. <div class="note"><span class="notetitle">Note:</span> By
|
|
using the code examples, you agree to the terms of the <a href="codedisclaimer.htm">Code license and disclaimer information</a>.</div>
|
|
<pre> /*********************************************************/
|
|
/* THIS IS A SAMPLE CODE FOR WATCH FOR TRACE EVENT */
|
|
/* FACILITY */
|
|
/* */
|
|
/* FUNCTION: WHEN THE TRACE OPTION SETTING PARAMETER */
|
|
/* INDICATES THAT A MESSAGE ID MATCHED WITH THE ONE BEING*/
|
|
/* WATCHED, THIS PROGRAM WILL PRINT THE HISTORY LOG AND */
|
|
/* STOP THE TRACE COMMAND EXECUTION. OTHERWISE, THIS */
|
|
/* WILL INDICATE TO CONTINUE WITH THE EXECUTION. */
|
|
/* */
|
|
/* NOTE: MYLIB/MYOBJECT IS A DATA AREA THAT IS */
|
|
/* CONTINUOUSLY CHANGING DURING THE PROCESS. THE USER */
|
|
/* WANTS TO DUMP IT PERIODICALLY TO CHECK HOW ITS */
|
|
/* CONTENT IS CHANGING AND WHAT IS THE FINAL VALUE */
|
|
/* WHEN THE WATCHED MESSAGE OCCURS. THIS DATA AREA */
|
|
/* WILL BE DUMPED AT THE BEGINNING (*ON), WHEN THE */
|
|
/* INTERVAL TIME ELAPSES (*INTVAL), AND WHEN THE */
|
|
/* WATCHED MESSAGE OCCURS (*MSGID) */
|
|
/* */
|
|
/* THE FOLLOWING IS AN EXAMPLE OF THE WATCH FOR TRACE */
|
|
/* EVENTS PARAMETERS, AS THEY WOULD BE SPECIFIED FOR A */
|
|
/* TRACE COMMAND ISSUING THE CURRENT SAMPLE CODE: */
|
|
/* */
|
|
/* WCHMSG((CPF0001)) TRCPGM(MYLIB/WCHEXTP) TRCPGMITV(30) */
|
|
/*********************************************************/
|
|
PGM PARM(&TRCOPTSET &RESERVED &OUTPUT &COMPDATA)
|
|
DCL VAR(&TRCOPTSET) TYPE(*CHAR) LEN(10) /* +
|
|
Reason why the program was called */
|
|
DCL VAR(&RESERVED) TYPE(*CHAR) LEN(10) /* This +
|
|
parameter is only used of TRCTCPAPP +
|
|
command and it is not relevant for Watch +
|
|
for Trace Event Facility */
|
|
DCL VAR(&OUTPUT) TYPE(*CHAR) LEN(10) /* +
|
|
Indicates if watch facility should stop +
|
|
or continue running */
|
|
DCL VAR(&COMPDATA) TYPE(*CHAR) LEN(92) /* Not +
|
|
needed for this sample */
|
|
/*********************************************************/
|
|
/* BEGIN OF PROGRAM PROCESSING */
|
|
/*********************************************************/
|
|
IF COND(&TRCOPTSET *EQ '*ON ') THEN(DO) +
|
|
/* If the program was called at the +
|
|
beginning of the processing. */
|
|
/* This section is usually used to set up +
|
|
the environment before the trace starts */
|
|
DMPOBJ OBJ(MYLIB/MYOBJECT) OBJTYPE(*DTAARA) /* Dump +
|
|
Object for problem determination */
|
|
CHGVAR VAR(&OUTPUT) VALUE('*CONTINUE ') /* Let the +
|
|
trace to continue running */
|
|
ENDDO /* End if *ON */
|
|
ELSE CMD(IF COND(&TRCOPTSET *EQ '*MSGID ') +
|
|
THEN(DO)) /* If the message id matched */
|
|
DSPLOG LOG(QHST) OUTPUT(*PRTSECLVL) /* Print the +
|
|
History Log */
|
|
DMPOBJ OBJ(MYLIB/MYOBJECT) OBJTYPE(*DTAARA) /* Dump +
|
|
object for problem determination */
|
|
CHGVAR VAR(&OUTPUT) VALUE('*STOP ') /* +
|
|
Indicates Watch Facility to Stop */
|
|
ENDDO /* End if *MSGID */
|
|
ELSE CMD(IF COND(&TRCOPTSET *EQ '*INTVAL ') +
|
|
THEN(DO)) /* If the exit program was +
|
|
called because the interval +
|
|
elapsed */
|
|
/* This section is usually used to perform +
|
|
tasks periodically. Like dumping objects, +
|
|
checking conditions and optionally end +
|
|
the watch facility */
|
|
DMPOBJ OBJ(MYLIB/MYOBJECT) OBJTYPE(*DTAARA) /* Dump +
|
|
object for problem determination */
|
|
CHGVAR VAR(&OUTPUT) VALUE('*CONTINUE ') /* Let the +
|
|
trace and the watch facility to continue +
|
|
running */
|
|
ENDDO /* End if *INTVAL */
|
|
ELSE CMD(CHGVAR VAR(&OUTPUT) VALUE('*CONTINUE ')) +
|
|
/* Otherwise, watch facility will +
|
|
continue running */
|
|
ENDPGM</pre>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzakuwatchexitpgmandexample.htm" title="You can specify exit programs in the trace program parameter to extend the capability of the watch function.">Example: Watch exit program</a></div>
|
|
</div>
|
|
<div class="relref"><strong>Related reference</strong><br />
|
|
<div><a href="rzakuextendwatchexitpgm.htm" title="Using the example exit program as a starting point, you can modify the code to allow the program to perform additional function.">Extend the watch function using the watch exit program example</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |