After successfully issuing DCMT VARY FILE segment-name.file-name DEALLOCATE, the related z/OS dataset is still in-use by the CV. The CV had to be shut down for another job to be able to successfully delete and re-define the dataset.
The physical dataset in question is also the physical file for another IDMS file in the same CV. This is possible although rarely done. All but one of the IDMS files would have to be in retrieval mode in the CV.
CA IDMS, all supported releases.
De-allocate the other files as well, or long term, change the DMCL so that this condition of sharing the same physical dataset across multiple IDMS file definitions doesn't exist.