Page 1 of 1

Select top 1 from ascii datasource

Posted: Thu Aug 04, 2011 9:56 am
by telula
Hello,
I am trying to read the first line of my ascii datasource to pick out parameters to zero out the cube. It's easily done in ODBC Connection where I use Select top 1 from dbo.datasource. How can I do similar for an ascii datasource ?

Re: Select top 1 from ascii datasource

Posted: Thu Aug 04, 2011 10:22 am
by lotsaram
ProcessBreak as last line of code on the data tab after reading the 1st record.
(or to break after x rows of data source just initialize a counter on the prolog and increment on the data tab with a check for the counter value in an IF statement enclosing the ProcessBreak.)

Re: Select top 1 from ascii datasource

Posted: Thu Aug 04, 2011 10:35 am
by telula
So if i put ExecuteProcess('Loading') after the process break,will that work?

Re: Select top 1 from ascii datasource

Posted: Thu Aug 04, 2011 10:43 am
by qml
It will if you put that line (ExecuteProcess) in the Epilog.

From the documentation on ProcessBreak:
This function stops processing source data and proceeds to the Epilog portion of a process.

Re: Select top 1 from ascii datasource

Posted: Thu Aug 04, 2011 10:50 am
by telula
thanks!