179 lines
11 KiB
HTML
179 lines
11 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: Creating a program temporary fix exit program" />
|
|
<meta name="abstract" content="This example creates a program temporary fix exit program." />
|
|
<meta name="description" content="This example creates a program temporary fix exit program." />
|
|
<meta name="DC.Relation" scheme="URI" content="apiexmp.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="apiexcrepro" />
|
|
<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: Creating a program temporary fix exit program</title>
|
|
</head>
|
|
<body id="apiexcrepro"><a name="apiexcrepro"><!-- --></a>
|
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
|
<h1 class="topictitle1">Example: Creating a program temporary fix exit program</h1>
|
|
<div><p>This example creates a program temporary fix exit program.</p>
|
|
<div class="section"><p>This example exit program covers the following possible
|
|
changes in the logical state of the PTF:</p>
|
|
<ul class="simple"><li>Loaded to temporarily applied</li>
|
|
<li>Temporarily applied to temporarily removed</li>
|
|
</ul>
|
|
<p>The example program shows where you can add your code. You can write
|
|
a PTF exit program in any programming language.</p>
|
|
<div class="note"><span class="notetitle">Note:</span> This example does
|
|
not show the apply-temporary to apply-permanent or the not-applied to remove-permanent
|
|
cases. It is assumed that all action was taken on the moves from loaded to
|
|
apply-temporary and from apply-temporary to not-applied. If additional actions
|
|
are necessary, code could be added to handle those transitions as well.</div>
|
|
<p>Do
|
|
not assume the default values for parameters on CL commands or for library
|
|
lists. Users can change these values. Library lists can vary from one system
|
|
to another.</p>
|
|
<div class="note"><span class="notetitle">Note:</span> Read the <a href="codedisclaimer.htm">Code license and disclaimer information</a> for
|
|
important legal information.</div>
|
|
<pre> /**** START OF SPECIFICATIONS *************************************/
|
|
/* */
|
|
/* LANGUAGE: CL */
|
|
/* */
|
|
/* APIs USED: None */
|
|
/* */
|
|
/* FUNCTION: */
|
|
/* THIS EXIT PROGRAM IS CALLED DURING ANY */
|
|
/* OF THE FOLLOWING CASES. */
|
|
/* */
|
|
/* APPLY TEMPORARILY - (user defined) */
|
|
/* */
|
|
/* APPLY PERMANENTLY - (user defined) */
|
|
/* */
|
|
/* REMOVE TEMPORARILY - (user defined) */
|
|
/* */
|
|
/* REMOVE PERMANENTLY - (user defined) */
|
|
/* */
|
|
/* Input: PARM1 - CHAR(7) - Product ID */
|
|
/* PARM2 CHAR(7) - PTF ID */
|
|
/* PARM3 - CHAR(6) - Product release */
|
|
/* PARM4 CHAR(4) - Product option ID */
|
|
/* PARM5 CHAR(4) - Product load ID */
|
|
/* PARM6 CHAR(10) - PTF library */
|
|
/* PARM7 CHAR(50) - User data */
|
|
/* PARM8 - CHAR(1) - Current PTF Status */
|
|
/* 0 - LOADED BUT NOT APPLIED */
|
|
/* 1 - APPLIED TEMPORARILY */
|
|
/* PARM9 CHAR(1) - PTF Operation */
|
|
/* 0 - REMOVE TEMPORARILY */
|
|
/* 1 - APPLY TEMPORARILY */
|
|
/* 2 - APPLY PERMANENTLY */
|
|
/* 3 - REMOVE PERMANENTLY */
|
|
/* 4 - PRE-REMOVE TEMPORARILY */
|
|
/* 5 - PRE-APPLY TEMPORARILY */
|
|
/* 6 - PRE-APPLY PERMANENTLY */
|
|
/* 7 - PRE-REMOVE PERMANENTLY */
|
|
/* */
|
|
/* */
|
|
/******* END OF SPECIFICATIONS ************************************/
|
|
PGM PARM(&PARM1 &PARM2 &PARM3 &PARM4 &PARM5 &PARM6 &PARM7 &PARM8 &PARM9)
|
|
/*------------------------------------------------------------------*/
|
|
/* */
|
|
/* DECLARE INPUT PARAMETERS */
|
|
/* */
|
|
/*------------------------------------------------------------------*/
|
|
|
|
DCL &PARM1 TYPE(*CHAR) LEN(7) /* Product ID */
|
|
DCL &PARM2 TYPE(*CHAR) LEN(7) /* PTF ID */
|
|
DCL &PARM3 TYPE(*CHAR) LEN(6) /* Product release */
|
|
DCL &PARM4 TYPE(*CHAR) LEN(4) /* Product option ID */
|
|
DCL &PARM5 TYPE(*CHAR) LEN(4) /* Product load ID */
|
|
DCL &PARM6 TYPE(*CHAR) LEN(10) /* PTF library */
|
|
DCL &PARM7 TYPE(*CHAR) LEN(50) /* User data */
|
|
DCL &PARM8 TYPE(*CHAR) LEN(1) /* Current PTF status */
|
|
DCL &PARM9 TYPE(*CHAR) LEN(1) /* PTF operation */
|
|
/*------------------------------------------------------------------*/</pre>
|
|
<pre> /*------------------------------------------------------------------*/
|
|
/* */
|
|
/* DECLARE VARIABLES */
|
|
/* */
|
|
/*------------------------------------------------------------------*/
|
|
DCL &ACTION TYPE(*CHAR) LEN(1) /* PTF action to occur */
|
|
DCL &STATUS TYPE(*CHAR) LEN(1) /* PTF current status */
|
|
/* Handle exceptions */
|
|
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(HDLERR))
|
|
|
|
|
|
CHGVAR VAR(&ACTION) VALUE(&PARM9) /* Gets action being performed */
|
|
CHGVAR VAR(&STATUS) VALUE(&PARM8) /* Gets current PTF status */
|
|
|
|
/*----------------------------------------------------------------*/
|
|
/* THE CURRENT STATUS OF THE PTF IS "LOADED (NOT APPLIED)" */
|
|
/*----------------------------------------------------------------*/
|
|
IF (&STATUS = '0') THEN(DO) /* If PTF is loaded but not applied */
|
|
IF (&ACTION = '1') THEN(DO) /* If action is temporarily */
|
|
/* applied then */
|
|
/*?---- TEMP APPLY - ADD YOUR STATEMENTS HERE ----- */
|
|
ENDDO
|
|
IF (&ACTION = '5') THEN(DO) /* If action will be temporarily */
|
|
/* apply then */
|
|
/*?---- PRE-TEMP APPLY - ADD YOUR STATEMENTS HERE ----- */
|
|
ENDDO
|
|
ENDDO /* End of loading the PTF */
|
|
|
|
/*----------------------------------------------------------------*/
|
|
/* THE CURRENT STATUS OF THE PTF IS "APPLIED TEMPORARILY" */
|
|
/*----------------------------------------------------------------*/
|
|
IF (&STATUS = '1') THEN(DO) /* If PTF is temporarily */
|
|
/* applied then */
|
|
IF (&ACTION = '0') THEN(DO) /* If action is temporarily */
|
|
/* removed then */
|
|
/*?---- TEMPORARILY REMOVE - ADD YOUR STATEMENTS HERE --- */
|
|
ENDDO
|
|
IF (&ACTION = '4') THEN(DO) /* If action will be temporarily */
|
|
/* remove then */
|
|
/*?---- PRE-TEMP REMOVE - ADD YOUR STATEMENTS HERE ----- */
|
|
ENDDO
|
|
ENDDO /* End of remove the PTF */
|
|
/*---------------------------------------------------------------*/
|
|
/* PTF HAS BEEN SUCCESSFULLY PROCESSED */
|
|
/*---------------------------------------------------------------*/
|
|
QSYS/SNDPGMMSG MSGID(CPC1214) MSGF(*LIBL/QCPFMSG) +
|
|
MSGDTA(*NONE) TOPGMQ(*PRV (* *NONE +
|
|
*NONE)) TOMSGQ(*TOPGMQ) MSGTYPE(*COMP)
|
|
RETURN
|
|
/*----------------------------------------------------------------*/
|
|
/* HANDLE ALL ERROR CONDITIONS */
|
|
/*----------------------------------------------------------------*/
|
|
HDLERR:
|
|
/* Try to back out any changes already made */
|
|
/* If nothing to back out or back-out operation was successful */
|
|
QSYS/SNDPGMMSG MSGID(CPF3638) MSGF(*LIBL/QCPFMSG) +
|
|
MSGDTA(*NONE) TOPGMQ(*PRV (* *NONE +
|
|
*NONE)) TOMSGQ(*TOPGMQ) MSGTYPE(*ESCAPE)
|
|
/* Else the permanent changes not backed out */
|
|
QSYS/SNDPGMMSG MSGID(CPF3639) MSGF(*LIBL/QCPFMSG) +
|
|
MSGDTA(*NONE) TOPGMQ(*PRV (* *NONE +
|
|
*NONE)) TOMSGQ(*TOPGMQ) MSGTYPE(*ESCAPE)
|
|
|
|
ENDPGM /* Return to external caller */</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="apiexmp.htm" title="Contains example programs that use APIs and exit programs.">Examples: APIs</a></div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html> |