1 | Qualified user space name | Input | Char(20) |
2 | User space format name | Input | Char(8) |
3 | Status format name | Input | Char(8) |
4 | Status information | Output | Char(*) |
5 | Length of status information | Input | Binary(4) |
6 | Error code | I/O | Char(*) |
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.
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 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.
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:
*CURLIB | The job's current library is used to locate the user space. If no library is specified as the current library for the job, the QGPL library is used. |
*LIBL | The library list is used to locate the user space. |
The actual library that is used is returned in the status information.
The format name for the input parameters that are contained in the user space. For the format of the structure, see SVRS0100 Format.
The format name for the status information returned on the API call. For the format of the structure, see SRST0100 Format.
The status information returned on the API call.
The length of the status information returned on the API call. The minimum length is 8 bytes.
The structure in which to return error information. For the format of the structure, see Error Code Parameter.
This format defines the input parameter group for the API.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Length of structure |
4 | 4 | BINARY(4) | Offset to save command parameters |
8 | 8 | BINARY(4) | Length of save command parameters |
12 | C | BINARY(4) | Offset to application data |
16 | 10 | BINARY(4) | Length of application data |
20 | 14 | BINARY(4) | Save command type |
24 | 18 | CHAR(10) | Exit program name |
34 | 22 | CHAR(10) | Exit program library |
44 | 2C | CHAR(8) | Target release |
CHAR(*) | Save command parameters | ||
CHAR(*) | Application data |
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 the 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. Refer to the save commands in the Control Language (CL) information for detailed information about valid parameters. Refer to the 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:
OBJ('/*') ('/QSYS.LIB' *OMIT) ('/QDLS.LIB' *OMIT)
These parameters save all objects that are not in libraries and that are not document library objects.
OBJ(FILE*) LIB(MYLIB) OBJTYPE(*FILE)
These parameters save all files with names that start with the characters FILE* in the library named MYLIB.
LIB(JOE)
These parameters save the library named JOE.
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.
1 | Save (SAV) command |
2 | Save Object (SAVOBJ) command |
3 | Save Document Library Object (SAVDLO) command |
4 | Save Library (SAVLIB) command |
5 | Save Changed Object (SAVCHGOBJ) command |
6 | Save Object (QsrSave) API |
7 | Save Object List (QSRSAVO) API |
8 | Save System Information (SAVSYSINF) command |
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:
blanks | The default value is used. |
*CURRENT | The object is to be restored to, and used on, the release of the operating system that is currently running on your system. The object can also be restored to a system with any subsequent release of the operating system. |
*PRV | The object is to be restored to the previous release with modification level 0 of the operating system. The object can also be restored to a system with any subsequent release of the operating system installed. |
target-release | The release in the format VxRxMx. The object can
be restored to a system with the specified release or with any subsequent
release of the operating system.
Valid VxRxM0 values depend on the current version, release, and modification level, and depend on the save operation being performed. See the valid values for the TGTRLS parameter table in the Backup and Recovery book for a complete list of valid values. |
This format defines the status information that is returned on the API call.
Offset | Type | Field | |
---|---|---|---|
Dec | Hex | ||
0 | 0 | BINARY(4) | Bytes returned |
4 | 4 | BINARY(4) | Bytes available |
8 | 8 | BINARY(4) | Transfer time |
12 | C | BINARY(4) | Transfer block size |
16 | 10 | BINARY(4) | Transfer block multiplier |
20 | 14 | BINARY(4) | Last block size |
24 | 18 | CHAR(10) | User space library used |
34 | 22 | CHAR(2) | Reserved |
36 | 24 | BINARY(4) | Decimal transfer time |
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.
Message ID | Error Message Text |
---|---|
CPF3700 E | All CPF37xx messages could be signalled. xx is from 01 to FF, excluding tape and diskette errors since the operation is a save to a save file. |
CPF3800 E | All CPF38xx messages could be signalled. xx is from 01 to FF, excluding tape and diskette errors since the operation is a save to a save file. |
CPF2115 E | Object &1 in &2 type *&3 damaged. |
CPF3C1E E | Required parameter &1 omitted. |
CPF3C21 E | Format name &1 is not valid. |
CPF3CF1 E | Error code parameter not valid. |
CPF8100 E | All CPF81xx messages could be returned. xx is from 01 to FF. |
CPF9800 E | All CPF98xx messages could be signaled. xx is from 01 to FF. |
CPF9999 E | Function check. &1 unmonitored by &2 at statement &5, instruction &3. |
CPFB8C0 E | Status information length for &1 API is not valid. |
CPFB8C1 E | Unsupported value for &1 API. |
CPFB8C2 E | Offset value for &1 API not valid. Reason &6. |
CPFB8C3 E | Length value for &1 API not valid. Reason &6. |
CPFB8C4 E | Unexpected condition with exit program for &1 API. Reason &6. |
CPFB8C5 E | Parameter &2 specified more than once for API &1. |
CPIB8C6 I | Trace data generated for API &1. |
CPFB8C7 E | Unsupported value for &1 API. |
CPFB8C8 E | Command syntax error detected by &1 API. |
CPFB8C9 E | Command exception occurred using &1 API. |
CPFB8CF E | Unexpected condition with &1 API. Reason &6. |
Top | Backup and Recovery APIs | APIs by category |