Command—add - trillium_discovery - trillium_quality - 17.1

Trillium DQ Repository Administrator Guide

Product type
Software
Portfolio
Verify
Product family
Trillium
Product
Trillium > Trillium Discovery
Trillium > Trillium Quality
Version
17.1
Language
English
Product name
Trillium Quality and Discovery
Title
Trillium DQ Repository Administrator Guide
Topic type
Overview
Administration
Configuration
Installation
Reference
How Do I
First publish date
2008

You use the add command to add a repository object, such as a loader connection or user.

You can also use the add command to add the name of a user-defined script to an internal repository table that is displayed in the Control Center. Users can then run the script and pass arguments to it by selecting its name from the Execute Server Action list in the Control Center.

Note: The command must be typed on a single line. The parameters vary, depending on the type of object you are adding. The add userscripts command must be run from the _control repository.

Syntax

add <repository_object> <param1 value> <param2 value>...

Syntax (add loader_connection)

add loader_connection NAME "<connection name to display>" 
TYPE <Loader Connection Type>
DESCRIPTION {"<description to display>"} 
PARAMETERS {DATA_DIRECTORY "<data file path using forward slashes>"
SCHEMA_DIRECTORY "<data file path using forward slashes>"
DATA_EXTENSIONS {<ext1> <ext2> <ext3>} 
SCHEMA_EXTENSIONS {<ext1> <ext2> <ext3>}}

See Loader Connection Properties for a description of the variables in this command.

Example

The following example creates a loader connection to a COBOL data source. In practice, the command must be typed on one line but is shown here on multiple lines for readability.

add loader_connection
    NAME “Team A Data”
    TYPE cobol
    DESCRIPTION “data from the marketing team”
         PARAMETERS {
         DATA_DIRECTORY “marketing/data/”
         SCHEMA_DIRECTORY “marketing/schemas/”
         DATA_EXTENSIONS {dat cbl}
         SCHEMA_EXTENSIONS {cpy cbl}
       }

Syntax (add userscripts)

add userscripts NAME "<display name>" 
DESCRIPTION "<description of script>" 
LOCATION "<full path>"

where,

NAME"<display name>"

Name of the script as you want it to appear in the Execute Server Action submenu in the Control Center.

DESCRIPTION "<description>"

Description of the user-defined script.

LOCATION "<full path>"

Location of the script, including filename. Use forward slashes to define the path.

Optional Parameters

Parameter

Description

SECURITY <1|0>

Type 1 to hide the script from limited users; type 0 to display the script to all users. (The default is 0.)

FIXEDARGS <arg1 arg2>

Arguments that are always passed to the script. You can use a literal value as an argument or one of the following:
$METABASE
 passes the name of the active repository
$USERNAME
passes the name of the logged on user
$DATADIR
passes the name of the repository data directory
$BINDIR
Passes the name of the binaries directory

USERARGS <n>

The number of arguments that need to be passed to the script by the user. The Control Center prompts only once for these arguments, and the user must respond with all the values, separated by a space.

An individual argument cannot contain a space.

Note: The add userscripts command must be run from the _control repository. If the add userscripts command contains both FIXEDARGS and USERARGS, the FIXEDARGS are passed to the script first.

The add userscripts command returns an ID number for the script. Make a record of that ID for future reference; you will need it if you want to delete the script from the table at some point.

Example

The following example adds a user-defined script named Trim Log to the internal repository table that is displayed in the Tools > Execute Server Action submenu. The command returns an ID number for the script, which you will need if you want to delete the script at a later time.

Note: In practice, the command must be typed on one line but is shown here on multiple lines for readability.
add userscripts
    NAME "Trim Log"
    DESCRIPTION "user-defined script to trim log files"
    PARAMETERS {
         LOCATION "C:/temp/trim.bat/"
         SECURITY 1
          FIXEDARGS 100 log
         USERARGS 2
       } 

Example of a Script

The following is a Windows batch file, shown here as an example of a user script.

echo off
set myparam1=%1
set myparam2=%2
set myparam3=%3
set myparam4=%4
echo %myparam1% > c:\temp\log1.log
echo %myparam2% > c:\temp\log2.log
echo %myparam3% > c:\temp\log3.log
echo %myparam4% > c:\temp\log4.log