dbt run macro is undefined

I am very new to dbt… and trying to figure this out…

top of model:

post_hook= [

These are in the macros area of my project

Once the model runs, I want these 2 macros to run.

dbt run: am getting an error message ‘REMOVE_SAP_ACCRUAL_FILE’ is undefined.

Where do I define it so it gets recognized?

from project.yml:

macro-paths: [“macros”]

Based on the information you provided, your macro has to be in a .sql file in the dbt_project_root_folder/macros

Such as


And inside the file the macro has to be defined inseide a macro statement like

    your macro code
{% endmacro %}

And I am not sure about case sensitivity in macro names

Thank you ! I didn’t end my macro names with “,sql”. My model has the following to call the macro:

and getting the error that SAP_ACCRUAL_FILE is undefined.
Can I not call 2 macros?

nevermind… I had the macro named as SAP_ACCRUAL_FILE,sql with a comma…

.sql is just the format of the file where you define your macros. But to call them you call like you were doing before

Calling the macro:


To define the macros (you can define more than one in a single file):


    your macro code
{% endmacro %}

{% macro SAP_ACCRUAL_FILE() %}
    your macro code
{% endmacro %}

Thank you for taking the time to respond. It is working perfectly now.