Save to Application (QaneSava) API


  Required Parameter Group:


  Service Program Name: QANESERV

  Default Public Authority: *USE

  Threadsafe: No

The Save to Application (QaneSava) API enables an application to receive the save records that are generated by a save-to-save-file operation. The application defines the save operation by specifying the type of save command, and by providing the save command parameters. The API calls an exit program to transfer the save records to the application instead of to the save file.

To use the API, the application must provide the following:

When processing the save command, the API does the following:

The program that calls the API is suspended while the save operation is being processed.


Restrictions

QTEMP should not be specified for the library name on the OUTFILE or SAVACTMSGQ parameter because the save command is submitted by a prestart job running in the QSYSWRK subsystem and not in the job that called the API. Locks should not be applied to save objects that would conflict with locks applied by the save operation running in the prestart job.

Objects saved by this API can only be restored by using the Restore from Application (QaneRsta) API, and only if restored to a current or a later release of the operating system from which these were saved.

The application must store the save records in the order presented, without modification, for the objects to be successfully restored.

Because the save command is processed from within a prestart job the adopted authority of the thread using the Save to Application (QaneSava) API will not be available to the save command. One way to give the prestart job more authority is to use the adopted authority to swap user profiles within the application before calling the Save to Application (QaneSava) API.


Authorities and Locks

Exit Program Library Authority
*EXECUTE

Exit Program Authority
*EXECUTE

User Space Lock
*SHRNUP

User Space Library Authority
*USE

User Space Authority
*USE

Save Command Library Authority
*EXECUTE

Save Command Authorities
See the save command

Saved Object Locks
See the Backing up your system topic collection.

Saved Object Authorities
See Authority required for objects used by commands in the Security reference topic collection.

Required Parameter Group

Qualified user space name
INPUT; CHAR(20)

The user space that contains all the control information for the save operation. The first 10 characters contain the user space name. The second 10 characters contain the name of the library where the user space is located.

You can use the following special values for the library name:

The actual library that is used is returned in the status information.

User space format name
INPUT; CHAR(8)

The format name for the input parameters that are contained in the user space. For the format of the structure, see SVRS0100 Format.

Status format name
INPUT; CHAR(8)

The format name for the status information returned on the API call. For the format of the structure, see SRST0100 Format.

Status information
OUTPUT; CHAR(*)

The status information returned on the API call.

Length of status information
INPUT; BINARY(4)

The length of the status information returned on the API call. The minimum length is 8 bytes.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


SVRS0100 Format

This format defines the input parameter group for the API.



Field Descriptions

Application data. Information that the application wants passed to the exit program. The content of this information is defined by the application. This field could contain information specific to the object being saved (such as the object name, size, and so forth), or it could contain the qualified name of another object that contains this information.

Exit program library. The name of the library that contains the exit program called by the API. the exit program.

Exit program name. The name of the exit program that is called by the API. See Save to Application Exit Program for additional details.

Length of application data. The length of the application data. This value is passed to the exit program. This value must be set to zero if there is no application data.

Length of save command parameters. The length of the save command parameters. The maximum allowable length is 32500 bytes for save commands.

Length of structure. The length of this structure, from the start of the input parameters to the last byte of the application data.

Offset to application data. The byte offset from the beginning of the user space to the start of the application data. This value must be set to zero if there is no application data.

Offset to save command parameters. The byte offset from the beginning of the user space to the start of the save command parameters.

Save command parameters. A character string that contains the save command parameters or save keys. These parameters are validated when the API submits the command for processing. See the save commands in the Control language topic collection for detailed information about valid parameters. See Save Object (QsrSave) API or Save Object List (QSRSAVO) API for detailed information about valid keys.

These additional restrictions apply to the save command parameters when you use this API:

The following examples illustrate the save command parameters that are required for typical save scenarios:

These additional restrictions apply to the command parameters when you use the Save Object (QsrSave) API or Save Object List (QSRSAVO) API.

Save command type. The type of save command that is to be processed.

Target release. The release level of the operating system on which you intend to use the object being saved. The value passed in this field is ignored when the value for Save command type is 8. The default is *CURRENT. The possible values are:



SRST0100 Format

This format defines the status information that is returned on the API call.



Field Descriptions

Bytes returned. The number of status information bytes returned. If the value specified in the length of status information parameter is larger than the specified status information structure, this value is set to the last byte of the returned information.

Bytes available. The number of status information bytes available for the specified status information format.

Decimal transfer time.The decimal portion of the transfer time in millionths of a second. If the value returned for Transfer time was 5 and the value returned for Decimal transfer time was 827352, then the total transfer time was 5.827352 seconds.

Reserved.This field is unused and will be returned with blanks.

Transfer block size. The number of bytes in the blocks transferred by the exit program.

Transfer block multiplier. The number of blocks successfully transferred by the exit program.

Last block size. The number of bytes in the last block transferred by the exit program.

The true transfer size of the operation is equal to the transfer block size multiplied by the transfer block multiplier plus the last block size.

Transfer time. The elapsed time, in seconds, that begins when the application calls the API, and ends when the API returns to the caller.

User space library used. The name of the user space library that is used in the API call.


Error Messages



API introduced: V4R3

[ Back to top | Backup and Recovery APIs | APIs by category ]