CHGSAVF (Change Save File)

CHGSAVF Command syntax diagram

 

Purpose

The Change Save File (CHGSAVF) command changes the attributes of a specified save file. The changes become a permanent part of the file and are kept until the file is either changed or deleted.

 

Restrictions

  1. The user of this command must have object operational authority and object management authority for the save file.
  2. The user of this command must have read authority for the specified library.

 

Required Parameters

FILE
Specifies the qualified name of the save file whose attributes are changed.

The name of the save file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. 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 to be searched.

save-file-name: Specify the name of the file that is to be used.

 

Optional Parameters

MAXRCDS
Specifies the maximum number of records the save file can reach. The size of the save file is estimated in bytes at 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. For example, to ensure that the save file does not exceed approximately 20 megabytes (20 x 2000), 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).

If the current number of records in the save file is greater than the new MAXRCDS, an error message is sent, the command ends, and the save file is not changed.

*SAME: The value does not change.

*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.

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.

*SAME: The value does not change.

*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.

*SAME: The value does not change.

*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.

Note: This includes multiple 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.

TEXT
Specifies the text that briefly describes the save file. More information on this parameter is in Commonly used parameters.

*SAME: The value does not change.

*BLANK: Text is not specified.

'description': Specify no more than 50 characters of text, enclosed in apostrophes.

Examples for CHGSAVF

Example 1: File Resources Allocated Immediately

CHGSAVF   FILE(ONLINE)  WAITFILE(*IMMED)

This command changes the save file named ONLINE so that when it is opened the file resources must be available immediately, or an error message is sent. No other files are changed.

Example 2: Changing Maximum Number of Records

CHGSAVF   FILE(ONLINE)  MAXRCDS(20000)

This command changes the save file named ONLINE so that it can have up to 20,000 records (approximately 10 megabytes).

Error messages for CHGSAVF

*ESCAPE Messages

CPF7304
File &1 in &2 not changed.