| TM1Tool v2.0 documentation |
Updated 08.08.2001 Henrik Olsen
|
What is TM1Tool:
TM1Tool is a command line tool where you can:
- execute TM1 processes / TM1 chores.
- delete all consolidated elements from a dimension
- delete cubes
- delete dimensions
- save/insert rules to/from files
- create/update dimensions from files
- save subsets to files
- create/update subsets from files
- save/insert views to/from files
You can run the tool directly from a shell or use it with a data transformation-
or scheduling tool.
Installation:
Copy your TM1Tool files into a directory of your choice.
tm1tool.exe - executable file.
tm1tooldoc.htm - documentation.
Requirement:
Starting a local server:
To start a local server you need the TM1 Perspectives installed on
your machine.
When starting a local server that relies on the adminserver, make sure
the adminserver files (tm1admsrv.exe) is in the system path.
Connecting to a server:
If you are using TM1Tool connecting to a server your local machine
need either TM1 Client, TM1 Server or TM1 Perspectives installed.
How to use the TM1Tool:
Syntax:
tm1tool[.exe] [-v] {[{-l | -l localServerName} -d localServerDataDirecrory
[-o localServerPort] [-r localServerProtocol]
[-a adminServer] [-u userName] [-w userPassword] ] or [-s serverName
-a adminServer -u userName -w userPassword]}
{{-p processName {string arg | (numeric arg)}* | -c chore} or {-i dimensionName}
or {-k cubeName} or {-m dimensionName}
or {-b cubeName -R ruleFile} or {-b cubeName -U ruleFile} or {-e newDimensionName -D dimensionFileName}
or {-n dimensionName -S subsetsFile} or {-n dimensionName -I subsetsFile}
or {-V viewFile} or {-W viewFile} or {-F parameter file}}*
Command line arguments:
-v verbose, show connections and sessions.
-s server name.
-l start local server/local server name, default: local (bug1).
-d datadirectory.
-a adminserver.
-u username.
-w userpassword.
-o port local server, default: 5000.
-r local server protocol (tcp/ipx), default: tcp.
-c chore.
-p process, parameters follow separated by spaces, numeric parameters
in paranthesis (bug2).
-i dimension name where you want the consolidated elements deleted.
-k delete cube
-m delete dimension
-b set current cube
-U file to save rules into
-R file containing rules to be inserted into currnet cube
-S file to save subsets into
-n set current dimension
-I file containing subsets to be created/updated
-e name of the new dimension
-D file containing the dimension to be created (file format: see examples)
-V file to save views into
-W file containing views to be created
-F file containing parameters for the TM1Tool
-? help screen.
Examples:
Running processes on a local server:
c:\tm1tool -l -d c:\tm1s7\pdata -p process1 -p process2
Running processes w/ 3 parameters and a chore on a server:
c:\tm1tool -s tm1serv -u user1 -w user1Password -a 123.123.123.123
-p process1 parm1 (234) parm3 -c chore
Deleting all consolidatet elements in dimention 'region':
c:\tm1tool -s tm1serv -u user1 -w user1Password -a 123.123.123.123
-i region
Delete the cube '97Sales'
c:\tm1tool -l -d c:\tm1s7\pdata -k 97sales
Save and create subsets using file subsets.txt:
c:\tm1tool -l -d c:\tm1s7\pdata -n dimsnaionName -S subsets.txt
c:\tm1tool -l -d c:\tm1s7\pdata -n dimsnaionName -I subsets.txt
Create a new dimension
c:\tm1tool -l -d c:\tm1s7\pdata -e newDimName -D dimFile.txt
The file format:
The records in the data file have fields delimited by commas
and optionally enclosed in quotes.
The records can be one of the following types:
Element records with the form:
ElementType, ElementName
where Element type can be:
N to specify a Simple Element.
C to specify a Consolidated Element.
S to specify a String Element
Component records of the form:
!, ConsolidatedElement, ComponentElement, Weight
Which specify one component of a Consolidated Element.
The Weight field is optional, and if not specified
is assumed to be one.
Example:
C,ALL
N,PART1
N,PART2
!,ALL,PART1
!,ALL,PART2
Save and create views using file view.txt:
c:\tm1tool -l -d c:\tm1s7\pdata -b cubeName -V view.txt
c:\tm1tool -l -d c:\tm1s7\pdata -b cubeName -W view.txt
Using the parameter file:
c:\tm1tool -(some parameter) -F file.txt -(some more parameter)
or just c:\tm1tool -F file.txt
Your parameter file may have comments using REM of //
Example parameter file:
-l -d c:\tm1s7\pdata -n dimsnaionName -S subsets.txt REM create view -b cubeName -W view.txt REM run processes -F param2.txt
Return values \ Error Codes:
If the TM1Tools executes correctly it return the value 0.
Other return values:
|
|
Error message |
|
|
Cannot connect to the API |
|
|
Cannot start local server |
|
|
Cannot connect the server |
|
|
Invalid parameter |
|
|
Incomplete request: need datadirectory for local server |
|
|
Incomplete request: need userID, userpassword and adminserver when connecting to a server |
|
|
Incomplete request: no server specified |
|
|
Incomplete request: no task specified |
|
|
Missing server name |
|
|
Missing user name |
|
|
Missing password |
|
|
Missing data directory |
|
|
Missing adminserver |
|
|
Missing process name |
|
|
Missing chore name |
|
|
Invalid protocol specified |
|
|
Missing dimension name |
|
|
Cannot find dimension on server |
|
|
Cannot make a copy of dimension |
|
|
Error finding element type |
|
|
Failed deleting one or more consolidated element |
|
|
New dimension inconsistent |
|
|
Cannot update dimension |
|
|
Missing cube name |
|
|
Missing dimension name |
|
|
Cannot find cube on server |
|
|
Cannot delete cube |
|
|
Error creating TM1ValArray |
|
|
Cannot delete dimension |
|
|
Missing rules file name |
|
|
No cube name is specifed to insert rules in, use either -k or -b |
|
|
Cannot open file |
|
|
Cannot insert rule |
|
|
Rules are not consistet |
|
|
The rules attached fails |
|
|
Missing subset file name |
|
|
Missing dimention file name |
|
|
No dimension name is specifed for the new dimension, use -e |
|
|
Cannot create dimension |
|
|
Dimension is not consistent |
|
|
Cannot find element in dimension |
|
|
Error inserting elenemt into subset |
|
|
Cannot register subset in dimension |
|
|
Error finding rule in cube |
|
|
Error finding number of lines in rule |
|
|
Error updating subset |
|
|
Missing view file name |
|
|
Missing view file name |
|
|
Error parsing file |
|
|
Cannot create view |
|
|
Error register view in cube |
|
|
Cannot find subset |
|
|
Error trying to get dimension name |
|
|
Cannot create new subset from dimension |
|
|
Error deleting elements from subset |
|
|
Cannot make a copy of subset |
|
|
Error selecting elements from subset |
|
|
The new dimension is not consistent |
|
|
Missing parameter input file name |
Bugs:
1) You have to shutdown the adminserver manually
after running a local server.
2) If you pass a process the wrong number of parameters
the process will not execute, the server will still respond that the process
executes successfully