Use of index function

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

It works with data type of Varchar also (Even for your stage variables in this case). Cross check your input seq file and the job design once more.

See if you have passed 'input.file_name' and not 'input.file_type' to stage variable 1.
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

I chcked the job again.
In the substring position I tried by giving empty string like
index(input.filename,"",1) and it is returning 1 which is right,but thr indexfunction is not reading the ".".
I also tried by assigning integer value to the stage variables as suggested by ray,but getting the same value 0 as result.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Put this in the occurance column: index('abcd.txt','.',1) and let know what you are getting in the output for that field
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
sjordery
Premium Member
Premium Member
Posts: 202
Joined: Thu Jun 08, 2006 5:58 am

Post by sjordery »

I deleted the stage variables.
Simply in the derivation stage of occurance column I used the index function like this index(input.filename,".",1) and its working fine.

thnx all
Post Reply