Object Language Syntax
An Integrator script contains objects to perform specific tasks. An object is defined by a set of attributes and consists of the reserved keyword object followed by:
- An object type in single quotes
- A string for the object name
- An open-brace ({)
- A comma-separated set of attributes followed by a close-brace (}) and a semicolon(;)
Keep the following points in mind:
- Each object defined in the script must begin with the keyword object and contain at least one set of open and close braces.
- The keyword object is case-insensitive.
- The final closing brace must be followed by a semi-colon.
object 'TYPENAME' "object name" {
<attributes if any>
};
object 'INPT' "filein-1-FIN" {
file_type = `column_headers`,
input_type = `filein`,
delimiter = `\t`,
starname = `/sourcedata/sales_$(input).txt`,
first = 100
};
Click any of the following component names for more details on the syntax.
Top line of the file must be defined with the required string:
version "1"
This is how Integrator recognizes the object language. It is not an indicator of the version number for the Integrator executable.
NOTE: A commented out line (// Script generated by DI Visual Integrator) ahead of the version line indicates that the script was created using Visual Integrator.
Strings following double forward slashes (//) are ignored during processing. You can place them anywhere in the line and text is ignored until the end of the line.
White space (spaces, tabs, new lines, and carriage returns ) can be used anywhere in the Integrator script except in the middle of identifiers.
Use the name in the following table to represent the appropriate object type. Object type names are case-sensitive and always use uppercase. See Integrator Object Language for a description of each object type.
| Object Type Name | Description |
|---|---|
| 'TSKL' | Task List object |
| 'TASK' | Task object |
| 'INPT' | Input object |
| 'PROC' | Process object |
| 'OUTP' | Output object |
| 'PARM' | Parameter object |
Each object type name identifies the specific attributes available, which directs Integrator in data manipulation.
Keep the following in mind when creating object names:
- The object name establishes the name of an object instance.
- It is recommended the object name contain one or more words that describe the expected data manipulation action.
- The object name must be enclosed in double quotes and immediately follow the object type.
- Object names are case-insensitive.
- Although multiple instances of an object can exist, object names must be unique to each script file. For example, there is only one OUTP object per task, but if a script has multiple tasks, there may be multiple OUTP objects in the script, and each needs a unique name.
- The maximum object name length is 200 characters.
A string is a sequence of characters enclosed in double quotes.
To form a string that contains double quotes or other special characters, precede the special character with a back slash (\). A forward slash (/) in a path is not a special character The back slash is used as an escape character. The following table shows characters you can represent using back slashes.
| Special Character | Code |
|---|---|
| New Line | \n |
| Double Quotes | \" |
| Back Slash | \\ |
| Carriage Return | \r |
| Tab | \t |
| ASCII character containing the value xxx in octal |
\xxx |
A number can either be an integer or a floating point number. An integer is represented by a series of digits. A floating point number is represented by a series of digits containing a decimal point (.). Keep the following points in mind when using numbers:
- A minus sign (-) preceding or trailing the number represents a negative number.
- Numbers in numeric operations cannot contain separators (such as commas).
- If numeric data contains commas or parentheses, a process object can be used to remove the separators prior to application of numeric operations.
- Floating point numbers are handled as a double precision (for example, double float) providing approximately 12-15 digits of precision.
- Numbers going from one process object to another are represented as character data, with up to six places after the decimal point.
An identifier is represented by a letter followed by a series of letters, digits, or underscores (_). An identifier is used to form reserved words or attribute names. The following shows examples of each type of identifier.
Reserved Work Examples
- INPT
- PROC
Attribute Name Examples
- trace_before
- new-value-column
An array is used to represent a set of values. An array can contain values of different types, although most arrays have values of a single type. An array is represented by a open-brace({), a comma-separated set of values, followed by a close-brace(}).
Example 1
{"January", "February", "March"}
Example 2
{
{"January", "01-Jan"},
{"February","02-Feb"},
{"March", "03-Mar"}
}
An attribute consists of an attribute name and an attribute value separated by an equal sign (=). An attribute value may be a string, number, or a complex object, such as an array or sub-object. Attribute names are case-insensitive. Optional attributes may be omitted from the object definition. Many attributes have default values but it is a best practice to include the attribute and its value. If an attribute name is plural, the attribute value must include braces even if only one value is specified.
Examples
process_type = "lookup"
num_vals = {20, 80}
columns = {"Revenue", "Salesperson", "District"}
inputs = {"in"}
A parameter string is a string of characters enclosed in backticks (`). The parameter name within the string is replaced at run time by the value specified on the command line or by a value that was defined using the Parameter object. Parameter strings can be used as attribute values or array values. For a parameter in a parameter string to be evaluated, the name must be preceded by a dollar sign ($). For example:
$(parameter_name)
After a parameter is defined in the Parameter object, various Input, Process, and Output objects in a script can use the parameter by including the parameter name in the parameter string. For example:
filename = ‘sales_$(year).txt‘
where year is the parameter defined in the Parameter object.
The recommended format for a parameter within a string is to include it within parentheses. For example, use $(year) instead of $year.
See Parameter Strings for information on defining parameter strings.
NOTE: The backtick (`) is typically positioned on a QWERTY keyboard below the tilde (~) to the left of the numeral one (1) key. The backtick is not the same as a single quote.
Consider the following when creating column names:
- When specifying the column names to be used for the Model or cBase components, avoid special characters other than spaces or underscores. In particular, avoid the following:
- [] , : (that is left bracket, right bracket, comma, colon), + - * / $ ( ) “ (that is signs for mathematical operations, dollar sign, parenthesis, and quotes).
- Also avoid numeric values as the first character for names, since that prevents its use in calculations. If a column name begins with a numeric value, make sure to use an alias for the column before using it in a Calc object definition. An alias can be provided using the Alias process object or the alias attribute found in various objects. If desired, the original name can be restored after the calculation has been performed by using another Alias object or using the alias attribute in a subsequent object in the flow.
This section describes the definitions for the Object Language. Use the table as a key to understand the syntax used to describe the language.
Syntax Notation
| Item | Description |
|---|---|
| terminal | Items in bold type represent terminals; the characters are put into the text. |
| non-terminal | Items in italics represent non-terminals; these are defined in terms of other non-terminals and terminals. |
| ’{’ | Characters in quotes represent single character terminals. |
| | | A vertical bar represent either-or choices. |
| (b)* | Parentheses followed by an asterisk represents the item in parentheses repeated some number of times. |
| ... | Ellipses represent a range of characters in a class. |
object_file::= header object_defns header::= version | version charset version::= version "1"; charset::= charset integer; object_defns::= object object_defns | object | #if dependency object_defns #endif | #if dependency object_defns #else object_defns #endif object::= object type_name obj_name obj_body | ignored_version object_defns | ignored_version ignored_version::=version string; type_name::=’’’ non_quote non_quote non_quote non_quote ’’’ obj_name::= string obj_body::= ’{’ attribute_list ’}’ | ’{’ ’}’ | ’{’ attribute_value ’}’ attribute_list::=attribute ’,’ attribute_list | attribute | attribute ’,’ | #if dependency attribute_list #endif | #if dependency attribute_list #else attribute_list #endif attribute::=attribute_name ’=’ attribute_value attribute_name::=letter (alphanum)* attribute_value::=number | string | array | subobject | parameter_string number::= (digit)* | (digit)* . (digit)* integer::= (digit)* simple_string::="(str char)*" string::= simple_string string | simple_string array::= ’{’ values ’}’ values::= attribute_value ’,’ values | attribute_value | #if dependency values #endif | #if dependency values #else values #endif subobject::=’{’ attribute_list ’}’ str char::= ASCII character except " and newline digit::= ’0’ ...’9’ letter::= ’A’ ... ’Z’ | ’a’ ... ’z’ alphanum::= letter | digit | ’_’ non_quote::=ASCII character except ’ dependency::=’!’ letter (alphanum)* | letter (alphanum)* parameter_string::=‘(parameter_string_char)*‘ parameter_string_char::= ASCII character except ‘ and newline parameter_name ::= letter (alphanum)* dependency::= parameter_name | '!' parameter_name | dependency_expr |'!' dependency_expr dependency_expr::= '(' dependency_expr2 ')' dependency_expr2::= dependency_expr3 | dependency_expr3 or dependency_expr2 dependency_expr3::= dependency_expr4 | dependency_expr4 and dependency_expr3 dependency_expr4::= dependency_expr | dependency_expr5 comparison dependency_expr5 | '!' dependency_expr6 | dependency_expr6 dependency_expr5::= parameter_name | integer | simple_string dependency_expr6::= '!' dependency_expr6 | dependency_expr | parameter_name comparison::= '='|'!='|'>'|'>='|'<'|'<='
NOTE: Dependency expressions (#if ... #endif) are not supported in the Workbench GUI. However, legacy scripts with dependencies can be used by 7.x processes. To remove these dependency expressions, you can rewrite the script, possibly into one or more scripts.