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:
 

Code
 Error message
100 
 Cannot connect to the API
101 
 Cannot start local server
102 
 Cannot connect the server 
103 
 Invalid parameter
104 
 Incomplete request: need datadirectory for local server
105 
 Incomplete request: need userID, userpassword and adminserver when connecting to a server
106 
 Incomplete request: no server specified
107 
 Incomplete request: no task specified
108 
 Missing server name
109 
 Missing user name
110 
 Missing password
111 
 Missing data directory
112 
 Missing adminserver
113 
 Missing process name
114 
 Missing chore name
115 
 Invalid protocol specified
116 
 Missing dimension name
117 
 Cannot find dimension on server
118 
 Cannot make a copy of dimension
119 
 Error finding element type
120 
 Failed deleting one or more consolidated element
121 
 New dimension inconsistent 
122 
 Cannot update dimension
123
 Missing cube name
124
 Missing dimension name
125
 Cannot find cube on server
126
 Cannot delete cube
127
 Error creating TM1ValArray
128
 Cannot delete dimension
129
 Missing rules file name
130
 No cube name is specifed to insert rules in, use either -k or -b
131
 Cannot open file
132
 Cannot insert rule
133
 Rules are not consistet
134
 The rules attached fails
135
 Missing subset file name
136
 Missing dimention file name
137
 No dimension name is specifed for the new dimension, use -e
138
 Cannot create dimension
139
 Dimension is not consistent
140
 Cannot find element in dimension
141
 Error inserting elenemt into subset
142
 Cannot register subset in dimension
143
 Error finding rule in cube
144
 Error finding number of lines in rule
145
 Error updating subset
146
 Missing view file name
147
 Missing view file name
148
 Error parsing file
149
 Cannot create view
150
 Error register view in cube
151
 Cannot find subset
152
 Error trying to get dimension name
153
 Cannot create new subset from dimension
154
 Error deleting elements from subset
155
 Cannot make a copy of subset
156
 Error selecting elements from subset
157
 The new dimension is not consistent
158
 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


TM1Tool v.2.0 CSC.NO (C) 2001, all rights reserved.Email: csc@csc.no