The TM1 function SCAN is case sensitive

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;

#Proof
AsciiOutput (‘F:\Temp\Outputs.txt’, NumberToString (l1), NumberToString (l2), NumberToString (l3), s1, s2 );