For producing basic oils and in particular very high quality oils, i.e.
oils possessing a high viscosity index (VI), a low aromatics content,
good UV stability and a low pour point, from oil cuts having an initial
boiling point higher than 340.degree. C., possibly with simultaneous
production of middle distillates (in particular gasoils and kerosene) of
very high quality, i.e. having a low aromatics content and a low pour
point, the invention provides a flexible procedure for producing oils and
middle distillates from a charge containing heteroatoms, i.e. containing
more than 200 ppm by weight of nitrogen, and more than 500 ppm by weight
of sulphur. The procedure comprises at least one hydrorefining stage, at
least one stage of catalytic dewaxing on zeolite, and at least one
hydrofinishing stage.