Resolve Case-sensitive TI Function SCAN PDF Print E-mail
Written by Roger   
Thursday, 15 September 2016 09:42





Cognos TM1 10.2.2

Microsoft Windows 2012 R2 server


The TI function SCAN does not find a match of data in a variable in the TI process.

After checking with ASCIIOUTPUT found that the word is with small letters and we search for capital letters.


The TM1 function SCAN is case sensitive.

Other functions that are case sensitive or space sensitive are;

TIMST are case sensitive. TIMST(366.0000, '\M \D, \Y') returns 'JAN 1, 1961'.

LONG and SUBST and Filter by Wildcard in subset editor is space sensitive.


Add UPPER to your question.

Change from

nLOB = SCAN (_LoB) , vITEM);



More information:

From http://www.tm1forum.com/viewtopic.php?t=1683

Here are examples:

# Will return 4
l1 = Scan ( 'def', 'abcdef');

# Will return 0
l2 = Scan ( 'def', 'ABCDEF');

#Will return 0
l3 = Scan ('def', 'a    b    c    d    e    f');

# Will return Match
If ( 'def' @= 'DEF');
s1 = 'Match';
s1 = 'No Match';

# Will return Match
If ( 'def' @= 'd e f ');
s2 = 'Match';
s2 = 'No Match';


Automatic option selection for prompt components “Properties of Select & Search Prompt” PDF Print E-mail


The prompt select and search components have a set of options to perform searches:



To solve the issue mentioned in the title you need to insert in the report a JavaScript code to let it choose by default one of the four options.

Please follow these steps:

1- Select a name for the component such as “search_request” (you can change it but you need to modify the JavaScript code).

2- The component from step 1 must be enclosed by two HTML elements.

The first one contains the code:


The second one contains the code:


/* Select and search options

* 2 - Starts with any of these keywords * DEFAULT

* 3 - Starts with the first keyword and contains all of the remaining keywords

* 4 - Contains any of these keywords

* 5 - Contains all of these keywords



3 - In the line: document.getElementById('search_request').getElementsByTagName('input')[4].click();


you can choose the default option that will be selected by modifying the number between closed brackets.

.cgi file example for Python and Cognos PDF Print E-mail


In this post we show an example of a Store Procedure call and an execution of a Python sentence from Cognos.

The three parameters are read from Cognos components and the AJAX call is done to a file named file.cgi located in CGIlocation.

The following javascript is executed from the Cognos report:

function funcionJS() {

var parameter1 = Number(getFormWarpRequest()._textEditBoxCOMPONENTE_COGNOS1.value); ;

var parameter2 = getFormWarpRequest()._oLstChoicesCOMPONENTE_COGNOS2.value;

var parameter3 = getFormWarpRequest()._oLstChoicesCOMPONENTE_COGNOS3.value;


url: "http://server/CGIlocation/file.cgi",

data: {

parameter1: parameter1,

parameter2: parameter2,

parameter3: parameter3


success:  function(data){

var data = $j.parseJSON(data);

print data.valor;},

error: onError




The .cgi file must contain the following code:


import cx_Oracle,cgitb, cgi, json

print "Status: 200 OK"
print "Content-Type: text/plain;charset=utf-8"

arguments = cgi.FieldStorage()

con = cx_Oracle.connect('user/pass@database')
cur = con.cursor();

par1= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter1 from the AJAX call

par2= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter2 from the AJAX call

par3= cur.var(cx_Oracle.STRING)
# Gets the parameter value parameter3 from the AJAX call

cur.execute("call PROCEDURE(:p1, :p2)", p1= par1, p2=par2)
cur.execute("SELECT A,B,C FROM TABLE where column1=:p1 and column2=:p3", p1=par1, p3=par3)

response = {"success": True, "message":"Successfully run", "data": cur.fetchall()}


print json.dumps(response)

TM1 instance won't start PDF Print E-mail
Written by Roger   
Wednesday, 27 July 2016 09:43

Cognos TM1 10.1
Microsoft Windows XP

The TM1 instance does not start – even when it is set to automatic in Windows services.

Error message in windows events:
Event Type: Error
Event Source: tm1sd
Event Category: None
Event ID: 0
Date: 7/27/2016

Time: 10:06:50 AM
User: N/A
The description for Event ID ( 0 ) in Source ( tm1sd ) cannot be found. The local computer may
not have the necessary registry information or message DLL files to display messages from a
remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description;
see Help and Support for details. The following information is part of the event: tm1sd error: 0,
Corrupt "tm1s.log" transaction log file. Server is coming down.

In tm1server log you find:
2728 [] FATAL 2016-07- 27 08:06:50.687 TM1.Transaction
TM1TransactionLog::ProcessTransactionLog: Bad transaction log record, line number 1.
2728 [] FATAL 2016-07- 27 08:06:50.687 TM1.Server Server terminated

In tm1s.log file there is:
"""20160715135733""CubeSerialized: }CubeProperties: by Admin"
#""";20160715135733""CubeSerialized: }DimensionProperties: by Admin"


Erase the tm1s.log file and then start the service.

TM1 java api error PDF Print E-mail
Written by Roger   
Monday, 25 July 2016 11:11


IBM Cognos TM1 10.2.2


Windows 2012 R2 server



When try to run the test script to call a Java code from a TI process outlined here



get an error in the TI process.


Error message:

Prolog procedure line (11):  Errors occurred during execution of process "my.scripts.MyTestTI".  
Check error log file for that process for more details


Check the tm1serverlog file for text like this:


2472  []   INFO   2016-07-25 13:30:30.643   TM1.Process  
[com.ibm.cognos.tm1.jos.extensions.ExtensionManager] - Insert new extension:
C:\Program Files\ibm\cognos\tm1_64\bin64\javaextensions\user\myextension.jar
2472  []   ERROR   2016-07-25 13:30:31.018   TM1.Process  
[com.ibm.cognos.tm1.jos.extensions.JarFileExtensionRecord] -Extension has
invalid extension.xml: C:\Program Files\ibm\cognos\tm1_64\bin64\javaextensions\user\myextension.jar
org.xml.sax.SAXParseException: Premature end of file.
	at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
	at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
	at com.ibm.cognos.tm1.jos.extensions.ExtensionXml.parseFromXML(ExtensionXml.java:86)
	at com.ibm.cognos.tm1.jos.extensions.JarFileExtensionRecord.load(JarFileExtensionRecord.java:83)
	at com.ibm.cognos.tm1.jos.extensions.ExtensionManager.insertExtension(ExtensionManager.java:96)
	at com.ibm.cognos.tm1.jos.extensions.LocalJarRepository.scan(LocalJarRepository.java:72)
 	at com.ibm.cognos.tm1.jos.extensions.ExtensionManager.addRepository(ExtensionManager.java:51)
	at com.ibm.cognos.tm1.jos.Main.addLocalRepository(Main.java:156)
	at com.ibm.cognos.tm1.jos.Main.main(Main.java:127)


This mean that the jar file is corrupt.

Stop your TM1 application and then from the JAVA IDE recompile the file with ANT.

This is done by save the project after a small change.

Remember to stop the TM1 application service before any change to the jar file.


It is good to only have the jar file in one folder, in the example it should be in folder for your Tm1 application, can be like this:



More information:





CogKnowHow Newsletter

Please register to the site before you can sign for a list.
No account yet? Register