Need to Generate below output using transformer stage.

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
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Need to Generate below output using transformer stage.

Post by ramakrishna459 »

TRACKID OFFSET EDIDATA
10 010 010 010 005 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
10 010 010 004 BBBBBBBBBBBBBBBBBBBBBB
10 010 010 010 010 005 SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
20 010 010 002 CCCCCCCCCCCCCCCCCCCC
20 010 007 ZZZZZZZZZZZZZZZZZ



O/P:

For the track id having similar trackid the offsets' should be conactenated and the EDIDATA should be concatenated.
When the Offset length reaches greater than 20 or the EDIDATA length reaches the length of 50 the 0/p should be
written to the new row.

TRACKID OFFSET EDIDATA
10 010 010 010 005 010 010 004 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBB
10 010 010 010 010 005 SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
20 010 010 002 010 007 CCCCCCCCCCCCCCCCCCCCZZZZZZZZZZZZZZZZZ
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Off you go then. You'll need some stage variables, sorted data partitioned on TRACKID, and possible use of looping within the Transformer stage (depending on how you plan to implement the 50 characters limit).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ramakrishna459
Participant
Posts: 37
Joined: Tue Mar 26, 2013 12:02 pm
Location: INDIA

Post by ramakrishna459 »

With the help of stage variables and looping and data sorted we acomplished.
Post Reply