Accessing environment variable from jinja code/macro

The problem I’m having is the environment variable which set in the dbt Cloud UI is not accessible in jinja set -{% set flag = env_var(‘dbt_FLAG’) %}

I wanted to access the environment variable value based on which I’m generating a value for the date.

Kindly help on this

Some example code or error messages

{% macro get_date() %}
{% set flag = env_var('DBT_FLAG') %}
{% if modules.datetime.date.today().day in (8,9,10,11,12,13) or flag == 1  %}
{% set var_date = modules.datetime.date.today() - modules.datetime.timedelta(days=modules.datetime.date.today().day) %}
{% else %}
{% set var_date = modules.datetime.date.today() %}
{% endif %}
{{ return(var_date) }}
 {% endmacro %}

Variable is accessible through the macro without any issue. Checked in compiled code.