CRTSAVF (Create Save File)
CRTSAVF Command syntax diagram
Purpose
The Create Save File (CRTSAVF) command creates an online save file. An online save file is used with save and restore commands to retain data that would otherwise be written to tape or diskette. The file can also be used like a database file to read or write records that contain save/restore information. An online save file can also be used to send objects to another user on the SNADS network. For more information on sending an online save file, see the Send Network File (SNDNETF) command.
Restrictions
- An online save file should only be used for save/restore data. When restoring objects from the save file, the data in the file must have been produced by a save command. When records are written to a save file by using a high-level language program, the records must contain data produced by saving objects into the save file.
- The records retrieved from a save file contain sequencing checksum information that is validated by the system when records are inserted into a save file. An attempt to insert records that are either out of sequence or have been changed since retrieval from a save file are rejected.
- A save file can contain the output of only one save operation and one library, and all objects in the save file must have been saved from the same library. If the SNDNETF command is used to send a save file, the maximum size of the save file is approximately 2 billion bytes. The number of objects saved in a save file is identical to the number of objects saved when saving to tape or diskette, as long as the file's maximum size is not exceeded. The exact number of objects saved into a save file depends on the object types and the object contents.
- The user must have object operational authority to the CRTSAVF command to create a duplicate save file or to restore a save file.
- The user must have add and read authority to the library in which the save file is located.
Required Parameters
- FILE
- Specifies the qualified name of the file being created. If the file is used by a high-level language (HLL) program, the file name must be consistent with the naming rules of that language; otherwise, the file must be renamed in the program.
The name of the save file can be qualified by one of the following library values:
*CURLIB: The save file is created in the current library for the job. If no library is specified as the current library for the job, the QGPL library is used.
library-name: Specify the name of the library where the save file is created.
file-name: Specify the name of the file being created.
Optional Parameters
- MAXRCDS
- Specifies the maximum number of records the save file can hold. The size of the save file is estimated in bytes about 8192 + (512 x number of records in the save file).
There is room for approximately two thousand 512-byte records in 1 megabyte of space. To ensure that the save file does not exceed approximately 20 megabytes (20 x 2,000), specify MAXRCDS (40000).
Note: The maximum amount of data that a save file can contain is approximately one terabyte (1,099,511,627,776 bytes). *NOMAX: The system maximum is used.
number-of-records: Specify the maximum number of records that the save file can contain. Valid values range from 1 through 2146762800.
- ASP
- Specifies the auxiliary storage pool (ASP) in which the system creates the save file.
*LIBASP: The save file is created in the same ASP as the one containing the library holding the file.
ASP-identifier: Specify a value ranging from 1 through 16 for the ASP identifier. These values can only be used if the ASP has already been configured on the system.
Note: The value of 1 is the system ASP and is always configured on the system.
- WAITFILE
- Specifies the number of seconds that the program waits for the file resources and session resources to be allocated when the file is opened, or for the device or session resources to be allocated when an acquire operation is performed to the file. If those resources are not allocated within the specified wait time, an error message is sent to the program. More information on this parameter is in Commonly used parameters.
Note: An immediate allocation of the device by the device resource is required when an acquire operation is performed to the file. *IMMED: The program does not wait; when the file is opened, an immediate allocation of the file resources is required.
*CLS: The job default wait time is used as the wait time for the file resources being allocated.
number-of-seconds: Specify the number of seconds that the program waits for the file resources to be allocated. Valid values range from 1 through 32767 seconds.
- SHARE
- Specifies whether the open data path (ODP) for the save file is shared with other programs in the routing step. When an ODP is shared, the programs accessing the file share facilities such as the file status and the buffer.
More information on shared database files is in the Database Programming topic in the Information Center.
*NO: The ODP created by the program with this attribute is not shared with other programs in the routing step. Every time a program opens the file with this attribute, a new ODP to the file is created and activated.
This includes several opens in the same program.
*YES: The ODP created with this attribute is shared with each program in the routing step that also specifies SHARE(*YES) when it opens the file.
Note: When SHARE(*YES) is specified and control is passed to a program, a read operation in that program retrieves the next input record. A write operation produces the next output record.
- AUT
- Specifies the authority given to users who do not have specific authority to the save file, who are not on an authorization list, and whose user group has no specific authority to the save file. More information on this parameter is in Commonly used parameters.
*EXCLUDE: The user cannot access the save file.
*ALL: The user can perform all operations except those limited to the owner or controlled by authorization list management authority. The user can control the object's existence, specify the security for the object, change the object, and perform basic functions on the object. The user also can change ownership of the save file.
*CHANGE: The user can perform all operations on the save file except those limited to the owner or controlled by object existence authority and object management authority. The user can change and perform basic functions on the save file. Change authority provides object operational authority and all data authority.
*LIBCRTAUT: The public authority for the save file is taken from the value on the CRTAUT parameter of the target library (the library that is to contain the save file). The public authority is determined when the save file is created. If the CRTAUT value for the library changes after the save file is created, the new value does not affect any existing objects.
*USE: The user can perform basic operations on the save file, such as running a program or reading a file. The user cannot change the save file. *USE authority provides object operational authority, read authority, and execute authority.
authorization-list-name: Specify the name of the authorization list used.
- TEXT
- Specifies the text that briefly describes the save file. More information on this parameter is in Commonly used parameters.
*BLANK: Text is not specified.
'description': Specify no more than 50 characters of text, enclosed in apostrophes.
Example for CRTSAVF
CRTSAVF FILE(ONLINE) TEXT('Online save file')This command creates an online save file named ONLINE in the current library. The save file is in the system ASP with no maximum number of records. The public has no authority to this file; only the object owner and users that have the object owner user profile as their group profile can use this save file.
Error messages for CRTSAVF
*ESCAPE Messages
- CPF7302
- File &1 not created in library &2.