The present invention relates to novel substituted hexahydroazepinones and tetrahydrobenzazepinones of the formulae ##STR1## wherein R.sup.1, Z.sup.1, Z.sup.2, W.sup.1, W.sup.2, Y.sup.1 and Y.sup.2 are as defined below, and to novel intermediates used in the synthesis of such compounds. Such compounds are useful in the treatment and prevention of gastrointestinal disorders, pain and anxiety disorders.