Changing the Access Method of a File

You can change the format of database files from non-VSAM to VSAM and vice versa.
You can change the format of database files from non-VSAM to VSAM and vice versa. The following list describes the process:
  1. Alter the file definition to change its access method and generate, punch, and link all DMCLs in which the file's segment is included. Optionally, you can specify a new database name or other location information.
  2. Allocate a new VSAM or non-VSAM data set, as described in Allocating and Formatting Files.
  3. Make the area to be processed unavailable for update under the central version.
  4. Make the new DMCLs and file available to the runtime environment.
Expand the Page Size
Converting from non-VSAM to VSAM
When you convert a non-VSAM file to VSAM, first expand the page size of the area, if the page size of the area is significantly smaller than the size of the VSAM control interval. The optimal page size is 8 bytes less than the VSAM control interval.
Converting from VSAM to non-VSAM
When you convert a VSAM file to non-VSAM, consider expanding the page size of the area, either before or after the conversion, if the page size of the area is inefficient for the device type.
Copy the Data to the New File
You can use one of the following two options to copy the data to the new file:
  • BACKUP and RESTORE utility statements
  • The IDCAMS utility
Backup and Restore Utility Statements
To use BACKUP and RESTORE to copy the database files, follow these steps:
  1. Offload the data in the old file(s) using the BACKUP utility statement and the old DMCL. If all files within a multi-file area are being converted, use the AREA option on the BACKUP statement; otherwise, use the FILE option.
  2. If the backup was performed with the AREA option, format the new files using the new DMCL before executing Step 3.
  3. Reload the data into the new file(s) using the RESTORE utility statement and the new DMCL. If the data was offloaded with the AREA option, restore with the AREA option; otherwise, restore with the FILE option.
Using the IDCAMS Utility
The REPRO command of the IDCAMS utility can be used to copy the data between a VSAM and non-VSAM file and vice versa. If you use this approach, be sure to copy all pages (blocks) in the file in their entirety without reblocking. For more information on IDCAMS, see the appropriate IBM documentation.