Purpose
To define a custom task.
Format
/CUSTOMTASK | [ALIAS alias] EXECUTABLE executable [ARGUMENTS arguments] [sources] [targets] [SUCCESSIF status] [EXECUTIONTAG tag] |
where
sources | = | SOURCES source [,source…] |
source | = | {STDIN } {NAMEDPIPE platformpipe_name} |
targets | = | TARGETS target [,target…] |
target | = | {STDOUT } {NAMEDPIPE platform pipe_name} |
platform | = | {WINDOWS} {UNIX } |
status | = | {EXITSTATUS comparison_operator numeric_value} {ALWAYS } |
comparison_operator | = | {= } equals {!=} does not equal {> } greater than {>=} greater thab or equal to (not less than) {< } less than {<=} less than or equal to (not greater than) |
Arguments
executable | the pathname of the custom executable to run. For details on specifying a file path, see File Name and Syntax Requirements. |
arguments | a character string indicating the arguments, separated by spaces, passed to the executable. |
alias | a name you assign to the custom task, and which you use to refer to the task in other Data Transformation Language options. The name assigned to the task must adhere to the rules described for an identifier. For details on specifying a file name, see File Name and Syntax Requirements. |
pipe_name | the pathname of the local or remote named pipe. On Windows systems, this is specified as \\<server>\pipe\<actual_pipe_name>. For details on specifying a file path, see File Name and Syntax Requirements. |
numeric_value | a number to compare the the exit status of the executable against, to determine the completion status of the custom task. |
tag | a character string you assign to the custom task that specifies an execution framework on which to run it. |
Location
The option may appear anywhere in the job definition.
Notes
The same custom task executable can be defined multiple times in the job definition.
When specifying multiple instances of the same custom task executable in the job, aliases need to be provided to make the task definition unambiguous. For example, if the first instance of a custom task definition does not have an alias, all subsequent definitions must have an alias specified.
Custom tasks cannot have multiple named pipes defined as sources or targets. Standard input (or output) can however be used in addition to a named pipe as a source (or target) of records.
Examples
/CUSTOMTASK EXECUTABLE echo ARGUMENTS "One Two Three"
/CUSTOMTASK EXECUTABLE cat SOURCES STDIN, NAMEDPIPE UNIX /pipe1
/CUSTOMTASK EXECUTABLE cat ARGUMENTS """c:\program files\file1.dat"" ""c:\program files\file2.dat"""
This custom task invokes the cat command with file names that require quotes since they have a space in their path. These quotes need to be escaped.