Wednesday, 6 October 2010

DM-STX-0119 incorrect number of columns

DM-STX-0119 incorrect number of columns occurs when you load a .CSV where the items are comma delimited but also enclosed in quotes. DM mistakenly treats a blank space following the double quotes as an end of line and will report a reduced number of columns even though excel and other programs have no problem reading the file.


"Airplane 101","Super Entendere" ,"200","600"

Will return 2 columns whereas:

"Airplane 101","Super Entendere","200","600"

Will return the correct number of columns, 4.

Saturday, 22 May 2010

Editing Functions and Procedures Hints

1. Never click on the X to close the window - you will NOT be prompted to save your edits.

2. Use OK instead. With big edits do this before any testing.

3. Always use Test button to perform a syntax check at the very least.

4. While debugging individual pieces of code use the delay function to view logmsg output.

5. NB you cannot edit while testing - this is not a nice Microsoft type environment more like the old style compilers so inspect what you are doing carefully before setting up a test.

Simple Array Example and using Delay to debug

Hi and welcome to any new followers.

Here is the code which could be used to run a routine in a while loops varying the arguments but with checks on the return code. This is difficult to do with nested ifs.


// when you test this be sure to define the correct types
$tb_list :=
'301' &
'302' &
'121' &
'131' &
'132' &
'133' &
'134' &
'135' &
'136' &
'137' &
'230' ; // type array

$tb_index := 1 ; // type integer

WHILE ( $tb_index <= ArraySize($tb_list)) DO
BEGIN
$tb_this := ArrayItem($tb_list,$tb_index) ; // type char(10)
logApollo(concat('Processing ',$tb_this)) ; // this logs and does a dos echo
$tb_index := $tb_index + 1 ;

// use this to debug output
delay(1) ;

END

// use this to debug output
delay(10) ;

Here is the logger routine

Logmsg(message);
system(concat('echo ',message)) ;

Saturday, 20 March 2010

SQL code to list DM objects

This is useful if you want some docs on your objects. .


-- list_dm_elements.sql
-- works with SQL Server repository

SELECT [component_type]

,CASE
WHEN component_type = 'J' THEN 'Jobstream'
WHEN component_type = 'B' THEN 'Fact Build'
WHEN component_type = 'S' THEN 'Dim Build'
WHEN component_type = 'D' THEN 'Dimension'
WHEN component_type = 'H' THEN 'Dim Hierarchy'
WHEN component_type = 'L' THEN 'Dim Lookup'
WHEN component_type = 'T' THEN 'Template'
WHEN component_type = 'A' THEN 'Data Source'
WHEN component_type = 'F' THEN 'Function'
WHEN component_type = 'K' THEN 'Metadata Dim'
WHEN component_type = 'J' THEN 'Metatdata Collection'
WHEN component_type = 'N' THEN 'Name of Environment'
WHEN component_type = 'P' THEN 'Preferences'
WHEN component_type = 'R' THEN 'Folder'
ELSE '???????????'
END AS component_description
,[component_name]
FROM [dmcatalog].[dmcuser].[dsb_component]
ORDER BY component_type, component_name


DM uses a database as a repository. It seems to be a quite simple representation in Sequel of what might have been source code at some point.

dsb_component_line will contain the source code of each object which you can also view in datamanager.

Thursday, 27 August 2009

Rejected Records - overall and individual dimension settings



Are handled for the build overall (right click build - properties) and at each dimension that references a lookup (right click dimension - properties)

Saturday, 22 August 2009

Cognos Datamanager multi user Catalog

What DM does NOT do:


On opening the Catalog it does not copy the entire Catalog into memory. This would suggest that each user that opened and modified a catalog would overwrite his entire version each time he saved, thus making shared catalogs an impossibility.

This was suggested by COGNOS's recommendation for each user to have his individual version of the catalog.


What DM does:

DM reads the entire object tree at start up. If you change the name of an object in one session but not in another when you try to access you get

1. ERRORDM-CAT-0910 Export failed; JobStream 'LoadOrgExtractsToGroupTable' does not exist.--------------------------------------------------------------------------------

2. ERRORDM-CAT-0406 JobStream 'LoadOrgExtractsToGroupTable' cannot be validated.

This is a fatal error that takes you out of DM and hence explains Cognos' recommendation of individual versions of the catalog.


DM copies the catalog object by object into memory as they are accessed. When you 'Save' you write the altered versions of objects back to the database. I dont know if DM reads unaltered objects back from the database each time or whether it caches them.



What DM should do to allow multi user access to the same Catalog

DM should place a date modified at the root of the catalog tree and this should cause the tree to refresh if a version has an older version. All objects should be referred to by an internal code to prevent a name change causing confusion.

DM should never cache objects unless they are altered. When they are altered they should be locked on the database and other users should be able to view the object with a warning that they cannot alter it since someone else is altering it.



In the word of the Meerkat - ees simples for Cognos to sort out this major bugbear and misunderstood facet of the product.

Tuesday, 18 August 2009

FileRead funtion returns xFFFE though file is readable

The file is encoded in 16 bit Unicode - the xFFFE is a bof marker of this encoding. Edit the file in notepad and save it in ANSI (8 bit format).

Strictly speaking COGNOS need to expand the capability of DM since this was an output from COGNOS BI I was trying to read!