ALTER command is used to modify VSAM file attributes. We can change the attributes of VSAM file which we have mentioned in VSAM Cluster definition.
ALTER file-cluster-name [password] [ADDVOLUMES(volume-serial)] [BUFFERSPACE(size)] [EMPTY / NOEMPTY] [ERASE / NOERASE] [FREESPACE(CI-percentage CA-percentage)] [KEYS(length offset)] [NEWNAME(new-name)] [RECORDSIZE(average maximum)] [REMOVEVOLUMES(volume-serial)] [SCRATCH / NOSCRATCH] [TO(date) / FOR(days)] [UPGRADE / NOUPGRADE] [CATALOG(catalog-name [password]]
The syntax parameter description remains the same as we explained in VSAM - Define Cluster Syntax chapter.
Following example shows how to use ALTER command to increase Freespace, to add more volumes and to Alter Keys.
//JOBNAME1 JOB 'IBMMAINFRAMER',CLASS=C,PRTY=10,MSGCLASS=C, // MSGLEVEL=(1,1),NOTIFY=&SYSUID //* //STEP001 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * ALTER racfid.VSAM.KSDSFILE.TEST [ADDVOLUMES(5)] [FREESPACE(4 4)] [KEYS(5 3)] /*
If you execute the above JCL. Job should complete successfully with MAXCC = 0 and it will alter the Freespace, Volumes and Keys.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!