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.