# include

## Overview

The `include` statement is used to combine Transcript task files together.

## Syntax

**`include`***`taskfile`*

## Details

The `include` statement is used to combine two or more task files into a single script prior to commencement of execution.

{% hint style="info" %}
If using the Windows path delimiter - `\` - it is advisable to put the path+filename in double quotes to avoid the backslash being interpreted as an escape character
{% endhint %}

Before executing a task file, Transcript analyses the script and processes all the `include` statements. Wherever an `include` statement is encountered, the specified *taskfile* is read from disk and inserted into the script in place of the `include` statement itself.

### Command placement

As with most statements, `include` must occupy a single line of its own in the script.

## Additional notes

The *taskfile* argument is treated as relative to `<basedir>/system/config/transcript/`.

Multiple files may be included in a task file and any included file may include other files but a check is done to ensure that no infinite include loops are generated.

## Example

Given the following two files in `/system/config/transcript/` ...

```
# FILE 1: myscript.trs
option loglevel = DEBUGX

# import usage data from csp
import "system\extracted\AzureCSP\${dataDate}_csp_usage.csv" source CSP alias Usage
default dset csp.usage
rename column resource_id to meter_id

include import_customers.trs

option overwrite = no
set resource_subcategory to Generic
create column interval value individually
create mergedcolumn service_name separator " - " from resource_name resource_subcategory region
# etc ...
```

```
# FILE 2: import_customers.trs
import "system\extracted\AzureCSP\${dataDate}_csp_customers.csv" source CSP alias Customers
rename column CSP.Customers.ID to customer_id
# END FILE 2
```

Prior to execution the pre-processor will combine these into the single memory-resident Transcript task:

```
# FILE 1: myscript.trs
option loglevel = DEBUGX

# import usage data from csp
import "system\extracted\AzureCSP\${dataDate}_csp_usage.csv" source CSP alias Usage
default dset csp.usage
rename column resource_id to meter_id

# FILE 2: import_customers.trs
import "system\extracted\AzureCSP\${dataDate}_csp_customers.csv" source CSP alias Customers
rename column CSP.Customers.ID to customer_id
# END FILE 2

option overwrite = no
set resource_subcategory to Generic
create column interval value individually
create mergedcolumn service_name separator " - " from resource_name resource_subcategory region
# etc ...
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://olddocs.exivity.io/data-pipelines/transform/language/include.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
