ibm-information-center/dist/eclipse/plugins/i5OS.ic.apiref_5.4.0.1/expackrpg.htm

505 lines
23 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 in OPM RPG: Program for packaging a product" />
<meta name="abstract" content="The following program creates objects 12 through 14." />
<meta name="description" content="The following program creates objects 12 through 14." />
<meta name="DC.Relation" scheme="URI" content="ExTaskPackprog.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="expackrpg" />
<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 in OPM RPG: Program for packaging a product</title>
</head>
<body id="expackrpg"><a name="expackrpg"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Example in OPM RPG: Program for packaging a product</h1>
<div><p>The following program creates objects 12 through 14.</p>
<div class="section"><pre> F*****************************************************************
F*****************************************************************
F*
F*Program Name: SFTWPRDEX
F*
F*Language: OPM RPG
F*
F*Descriptive Name: Software Product Example
F*
F*Description: This example contains the steps necessary to
F* package your product like IBM products.
F*
F*Header Files Included: QUSEC - Error Code Parameter
F* (Copied into Program)
F* QSZCRTPD - Create Product Definition API
F* QSZCRTPL - Create Product Load API
F* QSZPKGPO - Package Product Option API
F*
F*****************************************************************
F*****************************************************************
FQPRINT O F 132 OF PRINTER
E* COMPILE TIME ARRAY
E OBJ 001 15 41
I*
I* Error Code Parameter Include for the APIs
I*
I* The following QUSEC include has been copied into this program
I* so that the variable length field can be defined as a fixed
I* length.
I*** START HEADER FILE SPECIFICATIONS ****************************
I*
I*Header File Name: H/QUSEC
I*
I*Descriptive Name: Error Code Parameter.
I*
I*5763-SS1 (C) Copyright IBM Corp. 1994,1994
I*All rights reserved.
I*US Government Users Restricted Rights -
I*Use, duplication or disclosure restricted
I*by GSA ADP Schedule Contract with IBM Corp.
I*
I*Licensed Materials-Property of IBM
I*
I*
I*Description: Include header file for the error code parameter.
I*
I*Header Files Included: None.
I*
I*Macros List: None.
I*
I*Structure List: Qus_EC_t
I*
I*Function Prototype List: None.
I*
I*Change Activity:
I*
I*CFD List:
I*
I*FLAG REASON LEVEL DATE PGMR CHANGE DESCRIPTION
I*---- ------------ ----- ------ --------- ----------------------
I*$A0= D2862000 3D10 931201 DPOHLSON: New Include
I*
I*End CFD List.
I*
I*Additional notes about the Change Activity
I*End Change Activity.
I*** END HEADER FILE SPECIFICATIONS ******************************
I*****************************************************************
I*Record structure for error code parameter
I**** ***
I*NOTE: The following type definition only defines the fixed
I* portion of the format. Varying length field exception
I* data will not be defined here.
I*****************************************************************
IQUSBN DS
I* Qus EC
I B 1 40QUSBNB
I* Bytes Provided
I B 5 80QUSBNC
I* Bytes Available
I 9 15 QUSBND
I* Exception Id
I 16 16 QUSBNF
I* Reserved
I* 17 17 QUSBNG
I*
I* Varying length
I 17 100 QUSBNG
I*
I* Create Product Definition API Include
I*
I/COPY QSYSINC/QRPGSRC,QSZCRTPD
I*
I* Create Product Load API Include
I*
I/COPY QSYSINC/QRPGSRC,QSZCRTPL
I*
I* Package Product Option API Include
I*
I/COPY QSYSINC/QRPGSRC,QSZPKGPO
I*
I*
I DS
I I 1 B 1 40NUMPOP
I I 1 B 5 80NUMLAN
I I 'ABC0050 ABC ' 9 28 PDFN
I I 'ABC Product' 29 78 TEXTD
I I '5072535010 ' 79 92 PHONE
I I '*NODYNNAM ' 93 102 ALWDYN
I I '*USE ' 103 112 PUBAUT
I I 'ABCPGMMRM2' 113 122 POSTM
I I 'ABCPGMMRM1' 123 132 PREM
I I 'ABCPGMMRI2' 133 142 POSTI
I I 'ABCPGMMRI1' 143 152 PREI
I*
I* Change Object Information Parameter
ICOBJI DS 49
I I 3 B 1 40NUMKEY
I I 13 B 5 80KEY13
I I 4 B 9 120LEN13
I 13 16 PID13
I I 12 B 17 200KEY12
I I 4 B 21 240LEN12
I 25 28 LID12
I I 5 B 29 320KEY5
I I 13 B 33 360LEN5
I 37 49 LP5
I*
I* Object Data Structure - Breakdown of fields in Array OBJ
IOBJDS DS
I 1 10 NAME
I 11 20 TYP
I 21 24 PID
I 25 28 LID
I 29 41 LP
I DS
I B 1 40RCVLEN
I I 0 B 5 80NUMBK
I I 1 B 9 120NUMBL
I I 0 B 13 160NUMBM
C*
C* Beginning of Mainline
C*
C* Create Product Definition Object - ABC0050
C*
C EXSR PRDDFN <span class="uicontrol">(1)</span>
C*
C* Create Product Load Objects - ABC0050 (MRM) and ABC0029 (MRI)
C*
C EXSR PRDLOD <span class="uicontrol">(2)</span>
C*
C* Change Object Description for all objects associated with
C* the ABC Product.
C*
C EXSR COBJD <span class="uicontrol">(3)</span>
C*
C* Package the ABC Product so that all the SAVLICPGM, RSTLIBPGM,
C* and DLTLICPGM commands work with the product.
C*
C EXSR PKGPO <span class="uicontrol">(4)</span>
C*
C* Complete; product is ready to ship.
C*
C SETON LR
C RETRN
C*
C* End of MAINLINE
C*
C*
C*****************************************************************
C*****************************************************************
C*
C* Subroutine: PRDDFN
C*
C* Descriptive Name: Create product definitions.
C*
C* Description: This subroutine creates the product definition
C* ABC0050 for the ABC Product.
C*
C*****************************************************************
C*****************************************************************
C*
C PRDDFN BEGSR
C* Setup for Product Definition
C* Fill Product Definition Information Parameter
C Z-ADD100 QUSBNB
C MOVEL'0ABCABC' QSZBCB Product ID
C MOVEL'V3R1M0' QSZBCC Release Level
C MOVEL'ABCMSG' QSZBCD Message File
C MOVEL'*CURRENT'QSZBCF First Copyright
C MOVEL'*CURRENT'QSZBCG Current Copyright
C MOVEL'941201' QSZBCH Release Date
C MOVEL'*NO' QSZBCJ Allow multiple rel.
C MOVEL'*PHONE' QSZBCK Registration ID Value
C MOVELPHONE QSZBCL Registration ID Value
C* Fill Product Load Parameter
C MOVEL'0000' QSZBDB Product Option Number
C MOVEL'ABC0001' QSZBDC Message ID
C MOVELALWDYN QSZBDD Allow Dynamic Naming
C MOVEL'5001' QSZBDF Code Load ID
C MOVEL*BLANKS QSZBDG Reserved
C* Fill Language Load List Parameter
C MOVEL'2924 'QSZBFB Language Load ID
C MOVEL'0000' QSZBFC Product Option Number
C MOVEL*BLANKS QSZBFD Reserved
C*
C* Create the Product Definition for the ABC Product
C*
C MOVEL'QSZCRTPD'API 10
C CALL 'QSZCRTPD'
C PARM PDFN Qual. Prod. Defn.
C PARM QSZBC Prod. Defn. Info.
C PARM QSZBD Prod. Option List
C PARM NUMPOP # Prod. Options
C PARM QSZBF Lang. Load List
C PARM NUMLAN # Lang. Load List
C PARM TEXTD Text Description
C PARM PUBAUT Public Authority
C PARM QUSBN Error Code
C* Check for errors returned in the error code parameter.
C EXSR ERRCOD
C ENDSR
C*
C*****************************************************************
C*****************************************************************
C*
C* Subroutine: PRDLOD
C*
C* Descriptive Name: Create product loads.
C*
C* Description: This subroutine creates the product loads,
C* ABC0050 and ABC0029, for the ABC Product.
C*
C*****************************************************************
C*****************************************************************
C*
C PRDLOD BEGSR
C*
C* Setup for Product Load for MRM Objects
C* Fill Product Load Information Parameter
C MOVEL'0ABCABC' QSZBHB Product ID
C MOVEL'V3R1M0' QSZBHC Release Level
C MOVEL'0000' QSZBHD Product Option
C MOVEL'*CODE' QSZBHF Product Load Type
C MOVEL'*CODEDFT'QSZBHG Load ID
C MOVEL'*PRDDFN' QSZBHH Registration ID Type
C MOVEL*BLANKS QSZBHJ Registration ID Value
C MOVEL'*CURRENT'QSZBCK Min. Target Release
C MOVEL*BLANKS QSZBCL Reserved
C*
C* Fill Principal Library Information Parameter
C MOVEL'ABC' QSZBJB Prin. Dev. Lib. Name
C MOVEL'ABC' QSZBJC Prin. Prim. Lib. Name
C MOVELPOSTM QSZBJD Post-Exit Prog. Name
C*
C* Fill Preoperation Exit Programs Parameter
C MOVELPREM QSZBLB Pre-Exit Prog. Name
C MOVEL'ABC' QSZBLC Dev. Lib. Name
C*
C* Fill Additional Library List Parameter
C* None
C*
C* Fill Folder List Parameter
C* None
C*
C* Create the product load for the ABC Product - MRM Objects
C*
C MOVEL'QSZCRTPL'API
C CALL 'QSZCRTPL'
C PARM 'ABC0050' PRDIDN 10 Prod. ID Name
C PARM QSZBH Prod. Defn. Info.
C PARM *BLANKS SECLIB 10 Sec. Lang. Lib
C PARM QSZBJ Principal Lib Info
C PARM QSZBK Add. Library List
C PARM 0 NUMBK # Add. Lib. List
C PARM QSZBL Pre-Exit Programs
C PARM 1 NUMBL # Pre-Exit Programs
C PARM QSZBM Folder List
C PARM 0 NUMBM # Folder List
C PARM TEXTD Text Description
C PARM '*USE' PUBAUT Public Authority
C PARM QUSBN Error Code
C* Check for errors returned in the error code parameter.
C EXSR ERRCOD
C*
C* Setup for Product Load for MRI Objects
C* Fill Product Load Information Parameter
C MOVEL'*LNG ' QSZBHF Product Load Type
C MOVEL'2924 'QSZBHG Load ID
C*
C* Fill Principal Library Information Parameter
C MOVELPOSTI QSZBJD Post-Exit Prog. Name
C*
C* Fill Preoperation Exit Programs Parameter
C MOVELPREI QSZBLB Pre-Exit Prog. Name
C*
C* Fill Additional Library List Parameter
C* None
C*
C* Fill Folder List Parameter
C* None
C*
C* Create the product load for the ABC Product - MRI Objects
C*
C MOVEL'QSZCRTPL'API
C CALL 'QSZCRTPL'
C PARM 'ABC0029' PRDIDN 10 Prod. ID Name
C PARM QSZBH Prod. Defn. Info.
C PARM 'ABC2924 'SECLIB Sec. Lang. Lib
C PARM QSZBJ Principal Lib Info
C PARM QSZBK Add. Library List
C PARM 0 NUMBK # Add. Lib. List
C PARM QSZBL Pre-Exit Programs
C PARM 1 NUMBL # Pre-Exit Programs
C PARM QSZBM Folder List
C PARM 0 NUMBM # Folder List
C PARM TEXTD Text Description
C PARM '*USE' PUBAUT Public Authority
C PARM QUSBN Error Code
C* Check for errors returned in the error code parameter.
C EXSR ERRCOD
C ENDSR
C*
C*****************************************************************
C*****************************************************************
C*
C* Subroutine: COBJD
C*
C* Descriptive Name: Change object descriptions for the
C* ABC Product.
C*
C* Description: This subroutine changes the object
C* descriptions for all objects that make up the
C* ABC Product. Currently, 15 objects exist. They
C* are listed at the end of this program.
C*
C*****************************************************************
C*****************************************************************
C*
C COBJD BEGSR
C*
C* Need to associate all objects with the ABC Product
C 1 DO 15 I 30
C MOVE OBJ,I OBJDS
C NAME CAT 'ABC' QOBJNM 20
C MOVELLP LP5
C MOVELPID PID13
C MOVELLID LID12
C MOVELTYP TYPE 10
C MOVEL'QLICOBJD'API
C CALL 'QLICOBJD'
C PARM RTNLIB 10 Returned Lib. Name
C PARM QOBJNM Qual. Object Name
C PARM TYPE Object Type
C PARM COBJI Chg'd Object Info.
C PARM QUSBN Error Code
C* Check for any errors returned in the error code parameter.
C EXSR ERRCOD
C ENDDO
C ENDSR
C*
C*****************************************************************
C*****************************************************************
C*
C* Subroutine: PKGPO
C*
C* Descriptive Name: Package software ABC Product.
C*
C* Description: This subroutine packages the ABC Product.
C* It makes sure that all objects exist that are
C* associated with the product.
C*
C*****************************************************************
C*****************************************************************
C*
C PKGPO BEGSR
C*
C* Setup for packing the ABC Product.
C* Fill Product Option Information Parameter
C MOVEL'0000' QSZBRB Product Option
C MOVEL'0ABCABC' QSZBRC Product ID
C MOVEL'V3R1M0' QSZBRD Release Level
C MOVEL'*ALL 'QSZBRF Load ID
C MOVEL*BLANKS QSZBRG Reserved
C*
C* Package the ABC Product.
C*
C*
C MOVEL'QSZPKGPO'API
C CALL 'QSZPKGPO'
C PARM QSZBR Prod. Option Info.
C PARM '*YES' REPKG 4 Repackage
C PARM '*NO ' ALWCHG 5 Allow Object Change
C PARM QUSBN Error Code
C* Check for any errors returned in the error code parameter.
C EXSR ERRCOD
C ENDSR
C*
C*****************************************************************
C*****************************************************************
C*
C* Subroutine: ERRCOD
C*
C* Descriptive Name: Process API errors.
C*
C* Description: This subroutine prints a line to a spooled
C* file if any errors are returned in the error code
C* parameter.
C*
C*****************************************************************
C*****************************************************************
C*
C ERRCOD BEGSR
C QUSBNC IFNE 0
C*
C* Process errors returned from the API.
C*
C EXCPTBADNWS
C END
C ENDSR
OQPRINT E 106 BADNWS
O 'Failed in API '
O API
O 'with error '
O QUSBND
O* The information below is for array OBJ.
O*111 represents the object name.
O*2222222222 represents the object type.
O*3333 represents the product option ID.
O*4444 represents the product option load ID.
O*5555555555555 represents the licensed program.
O*1112222222222333344445555555555555
**
ABCPGMMRM1*PGM 000050010ABCABCV3R1M0
ABCPGMMRM2*PGM 000050010ABCABCV3R1M0
ABCPGMMRI1*PGM 000029240ABCABCV3R1M0
ABCPGMMRI2*PGM 000029240ABCABCV3R1M0
ABCPGM *PGM 000050010ABCABCV3R1M0
QCLSRC *FILE 000029240ABCABCV3R1M0
ABCDSPF *FILE 000029240ABCABCV3R1M0
ABCPF *FILE 000029240ABCABCV3R1M0
ABCMSG *MSGF 000029240ABCABCV3R1M0
ABC *CMD 000029240ABCABCV3R1M0
ABCPNLGRP *PNLGRP 000029240ABCABCV3R1M0
ABC0050 *PRDDFN 000050010ABCABCV3R1M0
ABC0050 *PRDLOD 000050010ABCABCV3R1M0
ABC0029 *PRDLOD 000029240ABCABCV3R1M0
ABC *LIB 000050010ABCABCV3R1M0</pre>
<p>Before you can build PTFs for the product, you need to save
the product and install the product by using the Save Licensed Program (SAVLICPGM)
and Restore Licensed Program (RSTLICPGM) commands.</p>
<p>Once the product
is built, you can do the following:</p>
<ul><li>Build PTFs for the product by using the following APIs: <ul><li>Create Program Temporary Fix (QPZCRTFX)</li>
<li>Retrieve Program Temporary Fix Information (QPZRTVFX)</li>
<li>Program Temporary Fix Exit Program</li>
</ul>
</li>
<li>Use save, restore, or delete license program (SAVLICPGM, RSTLICPGM, DLTLICPGM)
commands on it.</li>
<li>Retrieve information about the product by using the Retrieve Product Information
(QSZRTVPR) API.</li>
<li>Check the product to verify the existence of libraries, folders, and objects
that are part of the specified product (Check Product Option (CHKPRDOPT) command).</li>
</ul>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="ExTaskPackprog.htm" title="You can define, create, distribute, and maintain your own product using APIs. These examples demonstrate how you can use the APIs to package a product similar to the way IBM packages products.">Examples: Packaging your own software products</a></div>
</div>
</div>
</body>
</html>