Page 1 of 1

Difference between TI Text and Cube View

Posted: Thu Oct 17, 2019 3:28 pm
by MarenC
Hi,

I have created a process using a cube view as the source and have dynamically built the view on the prolog and then in the same process I have updated the meta and data tabs.

So in the prolog I have the following to make this work:

DatasourceType = 'VIEW';
DatasourceNameForServer = vCube;
DatasourcecubeView = vName;

In other words I can put everything in one process.

However when I come to write a process using a text file it doesn't allow me to do this, so if I create the text file in the prolog and I put the following

DatasourceType = 'CHARACTERDELIMITED';
DatasourceNameForServer = vFile;
DatasourceNameForClient= vFile;

I can't update on the meta and data tabs because I get an error saying process aborted and it says unable to open data source. If I then run the process again it works because the file then exists.

Is there any way I can get this to work so I don't have to create multiple processes?

Maren

Re: Difference between TI Text and Cube View

Posted: Thu Oct 17, 2019 4:13 pm
by Wim Gielis
You should just create a file manually with the same columns and a few lines. Like that you will have Variables and everything will work fine. The prolog tab can still set the data source in a dynamic way.

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 7:47 am
by MarenC
Hi Wim,

I know I can create the file manually and it will work. The point is that I want to create the file in the prolog (using powershell) and then use this file created in the prolog in the meta and data tabs. I can do this when the data source is a cube view but not when it is a text file.

Maren

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 9:21 am
by Wim Gielis
Do you have proper variables ?

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 9:28 am
by MarenC
Hi Wim,

Yes I defined all the variables using a file I had already created.

This file was then deleted and the file is created in the prolog via powershell.

If I run the process it creates the file but then aborts saying it can't open the data source. If I immediately run the process again it works fine as it can now find the data source.

Maren

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 9:44 am
by lotsaram
There should be no issue with creating the file in the prolog which you want to use as a datasource. TI does not try to access the datasource until the prolog is finished.

The issue you might have is that there is still a lock on the file.
- is the command line properly terminated?
- have you tried putting in a wait to allow PS to finish?

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 10:30 am
by MarenC
have you tried putting in a wait to allow PS to finish?
That was the problem. I had ExecuteCommand(vCmd, 0), I changed to ExecuteCommand(vCmd, 1) and it worked ok

Thank you very much

Maren

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 12:36 pm
by PavoGa
I do not know if this is what lotsaram was referring to, but an alternative is to use SLEEP(n) after the ExecuteCommand where n = milliseconds as another way of giving PS time to complete.

With ExecuteCommand, if something goes wrong in the called script and it gets hung up, your TI will sit there patiently waiting for it to complete when the second argument is set to "1".

Re: Difference between TI Text and Cube View

Posted: Fri Oct 18, 2019 1:06 pm
by MarenC
I updated to use sleep instead, thanks.

Maren