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.
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 |
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:
|
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. |
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.
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