I am trying to debug an issue in a process which was built by someone else. I am not very strong when it comes to writing TI's and the issue is occurring when the process attempts to set DataSourceType to null see below:
This snippet is executed when a string which is supposed to represent a cube does not exist. However it is killing the process before the error message gets logged.
Is datasourcetype null valid I'm guessing not, should this be set to 'none'?
Why are you trying to set the datasource type? Perhaps a little more of the script may help to understand what you are trying to accomplish?
Switching the datasource type from cube to 'none' has some implications on the variables. It might be better to check the existence of a cube and then execute one process or another depending on that answer using the ExecuteProcess command.
blackhawk wrote:Why are you trying to set the datasource type? Perhaps a little more of the script may help to understand what you are trying to accomplish?
Switching the datasource type from cube to 'none' has some implications on the variables. It might be better to check the existence of a cube and then execute one process or another depending on that answer using the ExecuteProcess command.
Can't post too much code since it is not mine to post. But after further investigation is looks like there are evaluation stack overflows. It was dying on that line but I think that that line was not what was causing the error, just the point at which the stack overflows killed the process.
You may want to change the datasourcetype if you want a single process to handle text and ODBC data sources for example, although I have never set it to 'NULL'.
Valid types include:
'CHARACTERDELIMITED', 'POSITIONDELIMITED', 'VIEW', 'SUBSET', ODBC' and 'OLEDBOLAP', 'SAPCHARACTERISTICTEXTS'
You need to use these in conjunction with the other local variables as stipulated in the Reference Guide.
Despite what you've been told in this thread setting DatasourceType = 'NULL' is actually a pretty common strategy to do on the Prolog tab if for some reason a data source validation test should fail. Essentially it sets the process at runtime to ignore the Metadata and Data tabs and proceed directly to the Epilog tab at the conclusion of the Prolog. You can achieve the same with ProcessBreak but this creates some extra verbosity in the server message log and causes the process to exit with a minor error code, both of which you might want to avoid.
Please place all requests for help in a public thread. I will not answer PMs requesting assistance.
lotsaram wrote:Despite what you've been told in this thread setting DatasourceType = 'NULL' is actually a pretty common strategy to do on the Prolog tab if for some reason a data source validation test should fail. Essentially it sets the process at runtime to ignore the Metadata and Data tabs and proceed directly to the Epilog tab at the conclusion of the Prolog. You can achieve the same with ProcessBreak but this creates some extra verbosity in the server message log and causes the process to exit with a minor error code, both of which you might want to avoid.
Thanks, I think you are right, that this is what the code intended.
I also use the DataSourceType = 'NULL' a lot. I have many TIs that load data from CSV files that are supposed to exist in a certain folder, and before i set the datasource, i check if the file exists or not. Also when using a cubeview as datasource, if any of the subsets of the view is empty, TM1 will throw an error. So instead i check the size of subsets and if any of them is zero then set DataSourceType = 'NULL'