Problem with Stage Variable Loop

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
KFajardo
Participant
Posts: 17
Joined: Mon May 11, 2015 7:22 pm
Location: Philippines

Problem with Stage Variable Loop

Post by KFajardo »

Hi guys,

Good afternoon.

I'm having a problem with my stage variable.

I am using it as a group #. but the problem is, it is inconsistent.

My data is this:


01|XXX
02|XXX
01|XXX
02|XXX
03|XXXX
01|XXX
02|XXX
03|XXXX

I want to group it this way:

1 01|XXX
1 02|XXX
2 01|XXX
3 02|XXX
3 03|XXXX
4 01|XXX
4 02|XXX
4 03|XXXX

but the actual result is:

1 01|XXX
1 02|XXX
2 01|XXX
0 02|XXX
3 03|XXXX
0 01|XXX
0 02|XXX
0 03|XXXX

The logic is: If the svGroupNum encounters a "01", it will add 1, Else svGroupNum.

my code is:

svGroupNum <-- If Col="01" then svGroupNum+1 else svGroupNum.


I can't see where the problem is. Does the partioning has something to do with?

Any help please.

Thank you.

-keith
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably partitioning. Try running the Transformer stage in sequential mode, so that no partitioning is required.

And please confirm that svGroupNum is an int of some kind and was initialized to 0.
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