Running a macro constitutes an implicit transaction. Therefore, in Teradata session mode, a macro need not be enclosed between BEGIN TRANSACTION and END TRANSACTION statements.
When the session performing a macro is in ANSI mode, the actions of the macro are uncommitted until a commit or rollback occurs in subsequent statements unless the macro body ends with a COMMIT statement. If you define a macro using a COMMIT statement, then it can be performed only in sessions running in ANSI mode.
If a macro is to run only in ANSI session mode, add a COMMIT WORK statement to the end of its definition.
If a macro is to run in ANSI and Teradata session modes, omit the COMMIT WORK statement from the definition. Tell users to specify a COMMIT WORK statement explicitly whenever they perform the macro in ANSI session mode
Users do not receive responses to individual statements contained in the macro body until all its requests have been completed successfully. Any object that is referenced by a request is locked until the macro transaction is completed, or until the macro is terminated because of a statement error.
If a macro contains a data definition statement, it cannot contain other requests. A data definition statement in a macro is not fully resolved until the macro is performed. At that time, unqualified references to database objects are resolved using the default database for the user submitting the EXECUTE statement. It is therefore recommended that object references in a macro data definition statement be fully qualified in the macro body.