The HDF_VG_DETACH procedure should be called when you are finished accessing a VGroup in a Hierarchical Data Format file. This routine must be called for every VGroup attached for writing before closing the HDF file in order to insure that VSET information is properly updated.
See HDF_SD_IDTOREF for an example using this function.