Page 1 of 1

Posted: Thu Jul 20, 2006 11:13 am
by us1aslam1us
Hi Prabhu

What exactly you want to do and what does the 3rd condition do?

Sam

Re: Need SubString

Posted: Thu Jul 20, 2006 11:39 am
by rwierdsm
praburaj,

You need an output column in your transform stage that has a derivation something along these lines:

Code: Select all

If input.expense_level [1,3] <> 'LPG' then input.expense_level else
if input.expense_level [1,3] = 'LPG' then 'NPG' : input.parent_expense_level [4,30] else  
if input.expense_level [1,3] = 'LPG' and index(input.expense_level, '*', 1) = 0 then >reject processing of your choice<
I wasn't completely clear on what you want in your second condition, but it should be something similar to what you see above.

If the Parent_expense_level is coming from your hash file as a lookup value, ensure you are setting either a constraint or a default value if the lookup fails.

Hope this helps,

Rob

Posted: Fri Jul 21, 2006 12:18 am
by ray.wurlod
Why me particularly? :?

Posted: Fri Jul 21, 2006 2:41 am
by praburaj
I expect all help. Plz help me. I want solve the problem.

Regards,

prabu

Posted: Fri Jul 21, 2006 9:59 am
by us1aslam1us
Hi Prabhu

I think you can join condition 2 and 3 and use Robs code like this:

Code: Select all

If input.expense_level [1,3] <> 'LPG' then input.expense_level else 
if input.expense_level [1,3] = 'LPG' and index(input.expense_level, '*', 1) = 1 then 'NPG' : input.parent_expense_level [4,30] else  
<reject or error>
IHTH
Sam

Posted: Fri Jul 21, 2006 8:41 pm
by DSguru2B
ray.wurlod wrote:Why me particularly? :?
Because your everyone's favourite :wink:

Actually you need to put the codes advised by our fellow forum users in a stage variable and for the last value specify a default value like say 'R'.
In the constraint of your target you need to specify
stgvar <> 'R'
and in the constraint for the reject file specify
stgvar = 'R'.

Posted: Mon Jul 24, 2006 2:40 am
by sb_akarmarkar

Code: Select all

If input.expense_level [1,3] <> 'LPG' then input.expense_level else 
if input.expense_level [1,3] = 'LPG' and index(input.expense_level, '*', 1) = 1 then 'NPG' : input.parent_expense_level ['*',1,1] else  
<reject or error> 

little change , Try this

Thanks,
Anupam