# tSambaOutput

Creates a file in a directory under a shared directory and writes data to the file. If the file already exists, this component overwrites the file. This component supports Samba version 2 and Samba version 3.

## tSambaOutput Standard properties

These properties are used to configure tSambaOutput running in the Standard Job framework.

The Standard tSambaOutput component belongs to the Internet family.

The component in this framework is available in all subscription-based Talend products.

Information noteNote: This component is available only when you have installed the 8.0 R2022-02 Talend Studio Monthly update or a later one delivered by Talend. For more information, check with your administrator.

## Basic settings

| Properties | Description |
| --- | --- |
| Property Type | Select the way the connection details<br>will be set.<br><br><ul> <li> <p> <span>Built-In</span>: The connection details will be set                          locally for this component. You need to specify the values for all                          related connection properties manually.</p> </li> <li> <p> <span>Repository</span>: The connection details stored                              centrally in <span><span>Repository</span><abbr> &gt; </abbr><span>Metadata</span></span> will be reused by this component.</p> <p>You need to click                              the <span>[...]</span> button next to it and in the pop-up                              <span>Repository Content</span> dialog box, select the                              connection details to be reused, and all related connection                              properties will be automatically filled in.</p> </li> </ul><br><br>This option is not available when you select the Use an existing<br>connection option and select a component from the<br>Component List dropdown list. |
| Use an existing connection | Select this check box and in the Component<br>List drop-down list, select the desired connection component to<br>reuse the connection details you already defined.<br><br>Information noteNote: When a Job contains the parent Job and the child Job, do the following if you<br>want to share an existing connection between the parent Job and the child Job (for example,<br>to share the connection created by the parent Job with the child Job).<br><br><ol> <li>In the parent level, register the database connection to be shared               in the <span>Basic settings</span> view of the               connection component which creates that very database connection. </li> <li>In the child level, use a dedicated connection component to read               that registered database connection. </li> </ol><br><br>For an example about how to share a database connection across Job levels,<br>see [Sharing a database connection](https://help.qlik.com/talend/r/en-US/7.3/studio-user-guide/sharing-database-connection). |
| Schema and Edit schema | A schema is a row description. It defines the number of fields<br>(columns) to be processed and passed on to the next component. When you create a Spark<br>Job, avoid the reserved word line when naming the<br>fields.<br><br><ul> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul><br><br>Click Edit<br>schema to make changes to the schema. If the current schema is of the Repository type, three options are available:<br><br><ul> <li> <p> <span>View schema</span>: choose this                option to view the schema only.</p> </li> <li> <p> <span>Change to built-in property</span>:                choose this option to change the schema to <span>Built-in</span> for local changes.</p> </li> <li> <p> <span>Update repository connection</span>:                choose this option to change the schema stored in the repository and decide whether                to propagate the changes to all the Jobs upon completion.</p> <p>If you just want to                propagate the changes to the current Job, you can select <span>No</span> upon completion and choose this schema metadata                again in the <span>Repository Content</span>                window.</p> </li> </ul><br><br>Click Sync columns to retrieve the schema from the previous component connected in the Job. |
| Host | The IP address or hostname of the Samba host.<br><br>This field is not available if you select the Use an existing connection option. |
| Username and<br>Password | Enter the authentication information required to access the Samba host.<br><br>To enter the password, click the [...] button<br>next to the Password field to bring out the Enter a new<br>password dialog box, enter the password in the text field, and click<br>OK. Note that you can enter the password either in a JSON string<br>in the pure password mode or as a Java expression in the Java<br>mode. You can toggle between the two modes by clicking switch to<br>Java mode or switch to pure password mode on the top<br>of the text field.<br><br>Information noteNote:<br><br><ul> <li>The two password modes are available only when you have installed the                  8.0.1-R2022-05 <span>Talend Studio</span>                  monthly update or a later one delivered by <span>Talend</span>. For more information, check with your administrator.</li> <li>If the 8.0.1-R2022-05 <span>Talend Studio</span>                  monthly update or a later one delivered by <span>Talend</span>                  is not installed, you can enter passwords in the <span>Java mode</span>                  only. </li> </ul><br><br>These two fields are not available if you select the Use an existing<br>connection option. |
| Domain | Enter the Samba host domain name.<br><br>This field is not available if you select the Use an existing connection option. |
| Share directory | Enter the share name of the shared directory where the desired file resides.<br>The shared directory will be the parent directory of the remote file. |
| Remote file | Enter the relative path to the file to write data to. If the file already<br>exists, it will be overwritten. |
| File type | Select the file type, JSON or<br>CSV. |
| Line separator type | Select the line separator: Windows type,<br>Linux type, or Other.<br><br>If you<br>select Other, specify the line separator in the<br>Line separator string field.<br><br>This option is<br>available if you select CSV from the File<br>type drop-down list. |
| Encoding type | Select the encoding type from the drop-down list: UTF 8,<br>ISO-8859-15 or Other.<br><br>If you select Other, specify the encoding in the Custom<br>encoding field.<br><br>This option is<br>available if you select CSV from the File<br>type drop-down list. |
| Set header | Select this option to treat the beginning lines as the header. You can specify<br>the number of lines that will be treated as the header in the Number<br>of lines field.<br><br>This option is<br>available if you select CSV from the File<br>type drop-down list. |
| Field separator type | Select the field separator from the drop-down list.<br><br>If you select Other, enter the character that will be<br>treated as the separator in the Field separator<br>field.<br><br>This option is<br>available if you select CSV from the File<br>type drop-down list.<br><br>Information noteNote: Currently, Space cannot be used as the field separator. |
| Create directory | Select this option to create the directories specified in the<br>Remote file field before writing data to the file if the<br>directories do not exist. |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStatCatcher Statistics | Select this checkbox to gather the Job processing metadata at the Job level<br>as well as at each component level. |
| Max batch size | Specify the maximum number of lines that can be written in a batch. |

## Global Variables

| Variables | Description |
| --- | --- |
| ERROR\_MESSAGE | The error message generated by the component when an error<br>occurs. This is an After variable and it returns a string. |
| NB\_LINE | The number of rows processed. This is an After variable and<br>it returns an integer. |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | Use this component to write a CSV or a JSON file using Samba v2<br>or v3 and separate fields using a field separator value. |