DB2 Server for VSE & VM: Database Services Utility


Load-Package Commands

Processing for the Load-Package Commands

Figure 99 indicates the data flow for the UNLOAD PACKAGE and RELOAD PACKAGE commands.
Note:PROGRAM is a synonym for PACKAGE. Therefore, UNLOAD and RELOAD PROGRAM are equivalent to UNLOAD and RELOAD PACKAGE.

Figure 99. Database Services Utility Processing Diagram for UNLOAD and RELOAD PACKAGE


REQTEXT

RELOAD PACKAGE

RELOAD PACKAGE Format



VM Format:

>>-RELOAD PACKAGE----(package_name)---+-NEW-----------------+--->
                                      |          .-KEEP---. |
                                      '-REPLACE--+--------+-'
                                                 '-REVOKE-'
 
>-----+--------------------------------+--INFILE----(ddname)---><
      |        .-,--------------.      |
      |        V                |      |
      '-TO--(-----server_name---+---)--'
 

VSE Format:

>>-RELOAD PACKAGE----(package_name)---+-NEW-----------------+--->
                                      |          .-KEEP---. |
                                      '-REPLACE--+--------+-'
                                                 '-REVOKE-'
 
>-----+--------------------------------+------------------------>
      |        .-,--------------.      |
      |        V                |      |
      '-TO--(-----server_name---+---)--'
 
>----INFILE--(--ddname--+---------------------------+----------->
                        |           .-2000--.       |
                        '-BLKSZ--(--+-size--+---)---'
 
>-----+----------------------------------+--)------------------><
      |                 .-REWIND---.     |
      |       .-(TAPE)--+-NOREWIND-+--.  |
      '-PDEV--+-(DASD)----------------+--'
 

VM Example:

 RELOAD PACKAGE(JONES.PROG4) REPLACE KEEP TO(RDB2,RDB3)
 INFILE(IN1)

VSE Example:

 RELOAD PACKAGE(JONES.PROG4) REPLACE KEEP INFILE(IN1)

Authorization:   You must be the owner of the package
that you want to reload. To reload another user's package, you must
have DBA authority. In VM, you must also have CONNECT authority to all
named databases.

PACKAGE (package_name)
identifies a RELOAD PACKAGE request and the package to be loaded.

You can further qualify the package_name with the owner, separating the two names with a period. The name of the package is package_name. If you do not specify the owner, owner defaults to the connected authorization ID. (See Qualifying Object Names for details on accessing data objects that are owned by other users.) The authorization ID is either:

REPLACE
is specified if an existing package is to be replaced by the reload. If the package does not exist, a new package is created without an error or warning message.

NEW
instructs the Database Services Utility that the package to be loaded does not exist and is to be created. If a package with the same name and owner already exists in the database, the reload fails.

KEEP
causes the grants of RUN privilege to remain in effect when the package is reloaded. The KEEP and REVOKE parameters apply if the package has previously been created and the owner of the package has granted the RUN privilege on the resulting package to other users. The KEEP and REVOKE parameters are allowed only with REPLACE; KEEP is the default.

REVOKE
if the REVOKE parameter is specified, or if the owner of the package is not entitled to grant all privileges embodied in the package, all existing grants of the RUN privilege are revoked. The KEEP and REVOKE parameters are allowed only with REPLACE; KEEP is the default.

TO (server-name)
in DB2 Server for VSE, this identifies the application server or servers onto which the package is to be reloaded. The Database Services Utility connects to each application server in turn, and if the connection is successful, the package is reloaded. If an LUW is active when the RELOAD command begins, processing is unsuccessful and an error occurs.

In DB2 Server for VM, this can be specified when you must load the package onto more than one database. To reload the package, the Database Services Utility connects to each specified server-name in turn (using database switching, which requires APPC/VM in multiple user mode). If an LUW is active when the RELOAD command begins, processing is unsuccessful and an error occurs.

When the TO clause is specified, the CONNECT statement is processed with no user ID or password. The attempted connection fails if implicit connections are not allowed on server-name. After the RELOAD is performed on each database, a COMMIT RELEASE (or ROLLBACK RELEASE) is done, releasing the connection to that server-name. The default user ID (the VM user ID) and the default database (as specified to SQLINIT) are reestablished for a new LUW. Any explicit connections done before the RELOAD are therefore lost and must be reissued if required.

If owner was not specified, the VM user ID is assumed, because it is the ID used to connect to each server-name.

When you use TO, the Database Services Utility ignores preceding CONNECT statements and uses the VM user ID as a default. If you do not want to use your VM user ID, issue the explicit CONNECT statements as required, and use the RELOAD command without a TO clause. If you do not specify the TO clause, the Database Services Utility reloads the package onto only the currently connected database.

There is no specific limit on the number of database names typed; however, there is an implied limit in that the maximum length of a Database Services Utility command is 8192 characters.

INFILE (ddname)
identifies and describes the sequential (SAM) tape or disk input file containing the package to be loaded into the database. The file must be created by UNLOAD PACKAGE processing, and its contents must not be changed in any way. RELOAD package processing uses a record format of fixed-length blocked (FB) and a record length of 80. The block size should be identical to that used for UNLOAD processing; that is, it must be a multiple of 80.

ddname
in DB2 Server for VSE: this is the TLBL or DLBL job control statement file name for the sequential input file.

Alternatively, RELOAD PACKAGE can read its input from SYSIPT by using a READ MEMBER. You use the READ MEMBER NOCONT option to properly close the SYSIPT file. An example of using READ MEMBER with NOCONT is:

RELOAD PACKAGE (package_name) REPLACE INFILE(SYSIPT);
READ MEMBER package_member (NOCONT

In DB2 Server for VM: this is the name of the sequential input file defined with a CMS FILEDEF command. Do not specify SYSIN or SYSPRINT as the ddname.

BLKSZ (size) (DB2 Server for VSE Only)
is an optional parameter that specifies the block size of the sequential output file. It should be identical to that used for UNLOAD processing; that is, it must be a multiple of 80. The default block size is 2000 bytes per block.

PDEV (TAPE or DASD)
is an optional parameter that specifies the device type (DASD or TAPE) of the sequential (SAM) input file. Specify PDEV(DASD) if the input file resides on any device supported by the VSE DTFSD macro. Specify PDEV(TAPE) if the input file resides on a device supported by the VSE DTFMT macro. The default is PDEV(TAPE).

REWIND or NOREWIND
controls tape file rewind processing performed during OPEN processing. This parameter is valid only if you specify TAPE for PDEV. The default processing is REWIND.

REWIND
specifies that the tape file is rewound by OPEN processing.

NOREWIND
specifies that the tape file is not rewound by OPEN processing. If NOREWIND is specified for input tape files referenced by a series of RELOAD commands, you must ensure that the tape files being referenced are in ascending sequence. For example, if NOREWIND is specified in a sequence of two RELOAD commands and the first command reads tape file 2, then the second command must reference tape file 3 or higher. If it references tape file 1, an OPEN error occurs.

UNLOAD PACKAGE

UNLOAD PACKAGE Format



Format:

>>-UNLOAD PACKAGE----(package_name)---+----------------------+-->
                                      '-FROM--(server_name)--'
 
>----OUTFILE--(--ddname--+--------------------------+----------->
                         |           .-2000--.      |
                         '-BLKSZ--(--+-size--+---)--'
 
>-----+-----------------------------------+--)-----------------><
      |                 .-NOREWIND--.     |
      |       .-(TAPE)--+-REWIND----+--.  |
      '-PDEV--+-(DASD)-----------------+--'
 

VM Example:

UNLOAD PACKAGE(PROG1) FROM(DB1) OUTFILE(OUT1)

VSE Example:

UNLOAD PACKAGE(PROG1) OUTFILE(OUT1)

Authorization:

You must be the owner of the package you want to unload. To unload
another user's package, you must have DBA authority.

In VM, you must also have CONNECT authority to a specified database.

The UNLOAD PACKAGE command unloads a specific package to a file. You can unload packages flagged as invalid in the database because RELOAD command processing automatically preprocesses the package again, thus revalidating it. Any unresolved dependencies in the package are then flagged when the RELOAD command preprocesses it again.
Note:The UNLOAD PACKAGE command is not supported if you are using DRDA flow.

Following are descriptions of each part of the command:

PACKAGE (package_name)
identifies an UNLOAD PACKAGE request and the package to be processed.

In DB2 Server for VSE, you can further qualify the package_name with the owner, separating the two names with a period.

The name of the package is package_name. If you do not specify the owner (see Qualifying Object Names for details), owner defaults to the currently connected authorization ID.

The DB2 Server for VM authorization ID is either:

FROM (server-name)
in DB2 Server for VSE, this identifies the application server against which the UNLOAD PACKAGE command should be issued. If an LUW is active, the UNLOAD command is unsuccessful and an error occurs.

In DB2 Server for VM, this identifies the application server containing the package. To unload the package, the Database Services Utility connects to the specified server_name (using application server switching, which requires APPC/VM in multiple user mode). If an LUW is active, the UNLOAD command fails with an error. When FROM is specified, the CONNECT is attempted with no user ID or password. The attempted connection fails if implicit connects are not allowed on server_name.

After the package is unloaded, a COMMIT (or ROLLBACK) RELEASE is done, releasing the connection to server_name. The default user ID (the VM user ID), and the default database (as specified to SQLINIT) are reestablished for a new LUW. Any explicit CONNECT statements that you issued before the UNLOAD command are therefore lost and must be reissued, if required. When you use FROM, the Database Services Utility ignores any preceding CONNECT statements and uses the VM user ID as a default. If you do not want to use your VM user ID, issue the explicit CONNECT statements as needed, and use the UNLOAD command without a FROM clause.

OUTFILE (ddname)
identifies and describes the sequential (SAM) tape or disk output file that is to contain the unloaded package. UNLOAD program processing uses a record format of fixed-length blocked (FB) and a record length of 80. The block size, in a VM environment, must be a multiple of 80 and defaults to 80 if not specified. This file contains only one unloaded package. If the file already exists, its contents are replaced; otherwise, the file is created.

ddname
in DB2 Server for VM, this is the name of the sequential output file defined with a CMS FILEDEF command. Do not specify SYSIN or SYSPRINT as the ddname.

In DB2 Server for VSE, this is the TLBL or DLBL job control statement file name for the sequential output file.

BLKSZ (size) (DB2 Server for VSE only)
is an optional parameter that specifies the block size of the sequential output file. It must be a multiple of 80. The default block size is 2000 bytes per block.

PDEV (TAPE or DASD)
is an optional parameter that specifies the device type (DASD or TAPE) for the sequential output file. Specify PDEV(DASD) for files that reside on any device supported by the VSE DTFSD macro. Specify PDEV(TAPE) for files that reside on any device supported by the VSE DTFMT macro. The default is PDEV(TAPE).

BLKSZ and PDEV can be specified in any order but must occur after the ddname parameter.

NOREWIND or REWIND
controls tape file rewind processing performed during CLOSE processing. This parameter is valid only if you specify TAPE for PDEV. The default is NOREWIND.

NOREWIND
specifies that the tape file is not rewound by CLOSE processing.

REWIND
specifies that the tape file is rewound by CLOSE processing.

REBIND PACKAGE

REBIND PACKAGE Format



Format:

>>-REBIND PACKAGE----(package_name)----------------------------><
 

Example:

 REBIND PACKAGE(SMITH.PROG)

Authorization:

You must be the owner of the package you want to rebind. To rebind
another user's package, you must have DBA authority.

The REBIND PACKAGE command allows you to repreprocess an existing package immediately without unloading and reloading the package. You can use the REBIND PACKAGE command with single or multiple user mode.
Note:The REBIND PACKAGE command is not supported if you are using the DRDA protocol.

Following is the description of the command:

PACKAGE (package_name)
identifies the package that you want to rebind.

You can qualify the name of the package by specifying the owner of the package; you must, however, have DBA authority to repreprocess a package belonging to another user. If you do not specify the owner, owner defaults to the connected authorization ID. See Qualifying Object Names for details on accessing data objects that are owned by other users.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]