Can't use this outside macro

You have used a directive outside a macro definition that can only be used
inside a macro definition. This includes directives like ENDM and EXITM.
For example,

SEGMENT DATA
ENDM ;error, not inside macro