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

 

 

Product:

 

Cognos TM1 10.2.2

Microsoft Windows 2012 R2 server


Symptom:

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.


Cause:

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.


Solution:

Add UPPER to your question.


Change from

nLOB = SCAN (_LoB) , vITEM);

to

nLOB = SCAN (_LOB), UPPER (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';
Else;
s1 = 'No Match';
EndIf;

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

 

 
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:

 

solicitud_busqueda.png


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

*/

document.getElementById('search_request').getElementsByTagName('input')[4].click();


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;

$j.ajax({

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

});

setTimeout("promptButtonFinish();",500);

}


The .cgi file must contain the following code:

 

import cx_Oracle,cgitb, cgi, json
cgitb.enable()

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

arguments = cgi.FieldStorage()

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

par1= cur.var(cx_Oracle.STRING)
par1.setvalue(0,(arguments["parameter1"].value))
# Gets the parameter value parameter1 from the AJAX call

par2= cur.var(cx_Oracle.STRING)
par2.setvalue(0,(arguments["parameter2"].value))
# Gets the parameter value parameter2 from the AJAX call

par3= cur.var(cx_Oracle.STRING)
par3.setvalue(0,(arguments["parameter3"].value))
# 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()}

cur.close()
con.close()

print json.dumps(response)


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

Product:
Cognos TM1 10.1
PLANANALYTICS_version=PLANANALYTICS-AW32- ML-RTM- 10.1.6237.212-0
Microsoft Windows XP

Symptom:
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
Computer: VCLASSBASE
Description:
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:
#LOG_FORMAT=1
#LOGID=E
"""20160715135733""CubeSerialized: }CubeProperties: by Admin"
#""";20160715135733""CubeSerialized: }DimensionProperties: by Admin"

Solution:

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

Product:

IBM Cognos TM1 10.2.2

PLANANALYTICS_Update_version=PLANANALYTICS-AW64-ML-RTM-10.2.5250.191-0

Windows 2012 R2 server

 

Symptom:

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

http://www.ibm.com/support/knowledgecenter/en/SS9RXT_10.3.0

/com.ibm.swg.ba.cognos.tm1_turb.10.3.0.doc/t_ti_configure_eclipse_java_ee_ide.html

get an error in the TI process.

 

Error message:

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

Solution:

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:

C:\Tm1apps\Tm1Beginner\data\}javaextensions\user

 

More information:

https://www.ibm.com/developerworks/community/forums/html/forum?id=9cd3aebf-c4bb-4059-91f1-9f0925b6b959&ps=25#topicsPg=1

 

 
«StartPrev1234567NextEnd»

 

CogKnowHow Newsletter

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