Complex logic

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
umamahes
Premium Member
Premium Member
Posts: 110
Joined: Tue Jul 04, 2006 9:08 pm

Complex logic

Post by umamahes »

I have an input file
Last edited by umamahes on Wed Jun 27, 2007 9:54 am, edited 2 times in total.
HI
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

This complex logic is too much for me. Could you please explain the rules in text as well?
JeroenDmt
Premium Member
Premium Member
Posts: 107
Joined: Wed Oct 26, 2005 7:36 am

Re: Complex logic

Post by JeroenDmt »

You can use a stage variable in a transformer to hold the parent value.
If you define the stagevariable svParent as:

Code: Select all

if IsNull(indata.Col1) then indata.Col2 else svParent
The value of this variable will change if a new parent record is found, and stay the same if child records are found.

Then you can use this stage variable to load the first column in the output.
Last edited by JeroenDmt on Wed Jun 27, 2007 1:19 am, edited 1 time in total.
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

Also add the constraint NOT(IsNull(indata.Col1)) in transformer :)
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>
JeroenDmt
Premium Member
Premium Member
Posts: 107
Joined: Wed Oct 26, 2005 7:36 am

Post by JeroenDmt »

JoshGeorge wrote:Also add the constraint NOT(IsNull(indata.Col1)) in transformer :)
Oops, yes, that would be useful too :)
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is this multi-level? Would you need to generate complete hierarchies, such as 1 2 3 4 5 6 ? That would add a deal of complexity (recursion), but could be solve using a carefully-designed hashed file and the little-known WITHIN query.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply