Many of the options of the ENVIRONMENT attribute affecting data set structure are not needed for VSAM data sets. If you specify them, they are either ignored or are used for checking purposes. If those that are checked conflict with the values defined for the data set, the UNDEFINEDFILE condition is raised when an attempt is made to open the file.
The ENVIRONMENT options applicable to VSAM data sets are:
BKWD BUFND (n) BUFNI (n) BUFSP (n) GENKEY PASSWORD (password-specification) REUSE SCALARVARYING SKIP VSAM
GENKEY and SCALARVARYING options have the same effect as they do when you use them for non-VSAM data sets. Note that under VSAM RLS, options BUFND, BUFNI and BUFSP are ignored.
The options that are checked for a VSAM data set are RECSIZE and, for a key-sequenced data set, KEYLENGTH and KEYLOC. Table 13 shows which options are ignored for VSAM. Table 13 also shows the required and default options.
For VSAM data sets, you specify the maximum and average lengths of the records to the Access Method Services utility when you define the data set. If you include the RECSIZE option in the file declaration for checking purposes, specify the maximum record size. If you specify RECSIZE and it conflicts with the values defined for the data set, the UNDEFINEDFILE condition is raised.
Use the BKWD option to specify backward processing for a SEQUENTIAL INPUT or SEQUENTIAL UPDATE file associated with a VSAM data set.
>>-BKWD--------------------------------------------------------><
Sequential reads (that is, reads without the KEY option) retrieve the previous record in sequence. For indexed data sets, the previous record is, in general, the record with the next lower key. However, if you are accessing the data set via a nonunique alternate index, records with the same key are recovered in their normal sequence. For example, if the records are:
A B C1 C2 C3 D E
where C1, C2, and C3 have the same key, they are recovered in the sequence:
E D C1 C2 C3 B A
When a file with the BKWD option is opened, the data set is positioned at the last record. ENDFILE is raised in the normal way when the start of the data set is reached.
Do not specify the BKWD option with either the REUSE option or the GENKEY option. Also, the WRITE statement is not allowed for files declared with the BKWD option.
Use the BUFND option to specify the number of data buffers required for a VSAM data set.
>>-BUFND--(n)--------------------------------------------------><
Multiple data buffers help performance when the file has the SEQUENTIAL attribute and you are processing long group of contiguous records sequentially.
Use the BUFNI option to specify the number of index buffers required for a VSAM key-sequence data set.
>>-BUFNI--(n)--------------------------------------------------><
Multiple index buffers help performance when the file has the KEYED attribute. Specify at least as many index buffers as there are levels in the index.
Use the BUFSP option to specify, in bytes, the total buffer space required for a VSAM data set (for both the data and index components).
>>-BUFSP--(n)--------------------------------------------------><
It is usually preferable to specify BUFNI and BUFND options rather than BUFSP.
For the description of this option, see GENKEY option — key classification.
When you define a VSAM data set to the system (using the DEFINE command of Access Method Services), you can associate READ and UPDATE passwords with it. From that point on, you must include the appropriate password in the declaration of any PL/I file that you use to access the data set.
>>-PASSWORD--(--password-specification--)----------------------><
The character string is padded or truncated to 8 characters and passed to VSAM for inspection. If the password is incorrect, the system operator is given a number of chances to specify the correct password. You specify the number of chances to be allowed when you define the data set. After this number of unsuccessful tries, the UNDEFINEDFILE condition is raised.
Use the REUSE option to specify that an OUTPUT file associated with a VSAM data set is to be used as a work file.
>>-REUSE-------------------------------------------------------><
The data set is treated as an empty data set each time the file is opened. Any secondary allocations for the data set are released, and the data set is treated exactly as if it were being opened for the first time.
Do not associate a file that has the REUSE option with a data set that has alternate indexes or the BKWD option, and do not open it for INPUT or UPDATE.
The REUSE option takes effect only if you specify REUSE in the Access Method Services DEFINE CLUSTER command.
Use the SKIP option of the ENVIRONMENT attribute to specify that the VSAM OPTCD "SKP" is to be used whenever possible. It is applicable to key-sequenced data sets that you access by means of a KEYED SEQUENTIAL INPUT or UPDATE file.
>>-SKIP--------------------------------------------------------><
You should specify this option for the file if your program accesses individual records scattered throughout the data set, but does so primarily in ascending key order.
Omit this option if your program reads large numbers of records sequentially without the use of the KEY option, or if it inserts large numbers of records at specific points in the data set (mass sequential insert).
It is never an error to specify (or omit) the SKIP option; its effect on performance is significant only in the circumstances described.
You must specify the VSAM option for VSAM data sets.
>>-VSAM--------------------------------------------------------><