# How to use multiple command line variables using --vars

**URL:** <https://discourse.getdbt.com/t/how-to-use-multiple-command-line-variables-using-vars/9612>\
**Category:** Help\
**Tags:** jinja, variables, dbt-core\
**Created:** [August 18, 2023, 11:43am UTC](https://discourse.getdbt.com/t/how-to-use-multiple-command-line-variables-using-vars/9612 "2023-08-18T11:43:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darshan](https://avatars.discourse-cdn.com/v4/letter/d/e47774/32.png) [@Darshan](https://discourse.getdbt.com/u/Darshan)\
**Post date:** [August 18, 2023, 11:43am UTC](https://discourse.getdbt.com/t/how-to-use-multiple-command-line-variables-using-vars/9612/1 "2023-08-18T11:43:12Z")

</div>

## The problem I’m having

Unable to run a dbt run with multiple variables with --vars option. passed as serialized json  
I am trying execute the below command.

```auto
dbt run --select path:/var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/tenant_jdespr/models/segmentation_input --vars '{"model_path": "models/segmentation_input", "sdate_fld": "sdate", "sqty_fld": "sqty", "item_tab": "marts_material_spr", "sales_hist_tab": "marts_sales_history_engine_spr", "gfu_item": "item", "gfu_loc": "loc", "gfu_cust": "cust", "seg_item": "item", "seg_loc": "loc", "seg_cust": "cust", "model_freq": "week", "generate_seg_param_age": true, "age_hist_length": 200, "age_hist_length_unit": "weeks", "age_param_groups": [{"AGE_NEW": [0, 24]}, {"AGE_SHORT": [24, 52]}, {"AGE_MEDIUM": [52, 104]}, {"AGE_LONG": [104, "INF"]}], "generate_seg_param_velocity": true, "velocity_hist_length": 200, "velocity_hist_length_unit": "weeks", "velocity_param_groups": [{"VELOCITY_A": [0, 80]}, {"VELOCITY_B": [80, 90]}, {"VELOCITY_C": [90, 95]}, {"VELOCITY_D": [95, 99]}, {"VELOCITY_E": [99, 100]}], "generate_seg_param_shiprate": true, "shiprate_hist_length": 52, "shiprate_hist_length_unit": "weeks", "shiprate_param_groups": [{"SHIPRATE_E": [0, 5]}, {"SHIPRATE_D": [5, 25]}, {"SHIPRATE_C": [25, 50]}, {"SHIPRATE_B": [50, 75]}, {"SHIPRATE_A": [75, 100]}], "tdate": "2023-08-14"}' --profiles-dir /var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/profiles --project-dir /var/folders/hx/cczdvpr10r18w09j6wyn6_jm0000gn/T/iaq2a8ad/dbt/tenant_jdespr

```

## What I’ve already tried

## Some example code or error messages

11:24:46 Found 42 models, 360 tests, 0 snapshots, 0 analyses, 719 macros, 0 operations, 0 seed files, 9 sources, 0 exposures, 0 metrics  
11:24:47 Encountered an error:  
Non-relative patterns are unsupported  
11:24:47 Traceback (most recent call last):  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/main.py”, line 135, in main  
results, succeeded = handle\_and\_check(args)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/main.py”, line 198, in handle\_and\_check  
task, res = run\_from\_args(parsed)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/main.py”, line 245, in run\_from\_args  
results = task.run()  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 453, in run  
self.\_runtime\_initialize()  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 165, in \_runtime\_initialize  
self.job\_queue = self.get\_graph\_queue()  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/task/runnable.py”, line 158, in get\_graph\_queue  
return selector.get\_graph\_queue(spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 274, in get\_graph\_queue  
selected\_nodes = self.get\_selected(spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 265, in get\_selected  
selected\_nodes, indirect\_only = self.select\_nodes(spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 157, in select\_nodes  
direct\_nodes, indirect\_nodes = self.select\_nodes\_recursively(spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select\_nodes\_recursively  
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in   
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select\_nodes\_recursively  
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in   
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in select\_nodes\_recursively  
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 131, in   
bundles = [self.select\_nodes\_recursively(component) for component in spec]  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 129, in select\_nodes\_recursively  
direct\_nodes, indirect\_nodes = self.get\_nodes\_from\_criteria(spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 86, in get\_nodes\_from\_criteria  
collected = self.select\_included(nodes, spec)  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector.py”, line 72, in select\_included  
return set(method.search(included\_nodes, spec.value))  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector\_methods.py”, line 287, in search  
paths = set(p.relative\_to(root) for p in root.glob(selector))  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/site-packages/dbt/graph/selector\_methods.py”, line 287, in   
paths = set(p.relative\_to(root) for p in root.glob(selector))  
File “/Users/darshanr/opt/anaconda3/envs/prefect\_garvis/lib/python3.10/pathlib.py”, line 1032, in glob  
raise NotImplementedError(“Non-relative patterns are unsupported”)  
NotImplementedError: Non-relative patterns are unsupported
