Change Save File (CHGSAVF)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

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

Restrictions:

Top

Parameters

Keyword Description Choices Notes
FILE Save file Qualified object name Required, Key, Positional 1
Qualifier 1: Save file Name
Qualifier 2: Library Name, *LIBL, *CURLIB
MAXRCDS Maximum records 1-2146762800, *SAME, *NOMAX Optional
TEXT Text 'description' Character value, *SAME, *BLANK Optional
WAITFILE Maximum file wait time Integer, *SAME, *IMMED, *CLS Optional
SHARE Share open data path *SAME, *NO, *YES Optional
Top

Save file (FILE)

Specifies the save file whose attributes are to be changed.

This is a required parameter.

Qualifier 1: Save file

name
Specify the name of the save file.

Qualifier 2: Library

*LIBL
All libraries in the library list for the current thread are searched until the first match is found.
*CURLIB
The current library for the thread is used to locate the save file. If no current library entry exists in the library list, the QGPL library is used.
name
Specify the name of the library where the save file is located.
Top

Maximum records (MAXRCDS)

Specifies the maximum number of records the save file can contain. The number of bytes of space in the save file is estimated at 8192 + (512 x the number of records in the save file). There is room for approximately two thousand 512-byte records in 1 megabyte of space. If you wanted to ensure that the save file would not exceed approximately 20 megabytes you would specify 40000 records (20 megabytes x 2000 records/megabyte).

If the current number of records in the save file is greater than the maximum, an error message is sent and the save file does not change.

Note: The maximum amount of data that a save file can contain is approximately 1 terabyte. A message appears when the file is full.

*SAME
The maximum number of records specified in the save file does not change.
*NOMAX
The maximum value of 2146762800 records is used.
1-2146762800
Specify the maximum number of records that the save file can contain.
Top

Text 'description' (TEXT)

Specifies the text that briefly describes the object.

*SAME
The text (if any) does not change.
*BLANK
No text is specified.
character-value
Specify no more than 50 characters of text, enclosed in apostrophes.
Top

Maximum file wait time (WAITFILE)

Specifies the number of seconds that the program waits for the file resources to be allocated when the file is opened. If the file resources cannot be allocated within the specified wait time, an error message is sent to the program.

*SAME
The wait time does not change.
*IMMED
The program does not wait. Immediate allocation of file resources is required.
*CLS
The job default wait time is used as the wait time for the file resources to be allocated.
1-32767
Specify the number of seconds to wait for file resources to be allocated.
Top

Share open data path (SHARE)

Specifies whether the open data path (ODP) is shared with other programs in the same routing step. When an ODP is shared, the programs accessing the file share facilities such as the file status and the buffer.

*SAME
The value specified in the save file does not change.
*NO
The ODP is not shared with other programs in the routing step. A new ODP for the file is created and used every time a program opens the file.
*YES
The same ODP is shared with each program in the job that also specifies *YES when it opens the file.
Top

Examples

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

Top

Error messages

*ESCAPE Messages

CPF7304
File &1 in &2 not changed.
Top