The magnetic behaviour of superconducting and nonsuperconducting DyBa2Cu3O7-y and HoBa2Cu3O7-y