What is the procedure to deallocate and reallocate a file with a different name?

Document ID : KB000024277
Last Modified Date : 14/02/2018
Show Technical Document Details

Introduction: 

The dataset name for a database file can be specified in the DMCL and also in the JCL. If specified in both locations, the dataset name in the JCL takes precedence during initial allocation of the file. If the file is deallocated to perform some maintenance or recovery when it is allocated again, IDMS by default will use the dataset name specified in the DMCL.

 

Question: 

What is the procedure to deallocate and reallocate a file with a different name or use the original dataset name specified in the JCL?

 

Answer: 

If you want to use a different dataset name or the original dataset name specified in the JCL then it needs to be specified using a DCMT command.

These are the commands required to deallocate the file:

DCMT V AREA segment_name.area_name OFF
DCMT V FILE segment_name.file_name CLOSE
DCMT V FILE segment_name.file_name DEALLOCATE

These are the commands required to reallocate the file and specifying a dataset name:

DCMT V FILE segment_name.file_name DSNAME dataset_name   
DCMT V AREA segment_name.area_name ON