denormalize seqential file data

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

Moderators: chulett, rschirm, roy

Post Reply
rahul.kissu
Participant
Posts: 6
Joined: Tue Sep 09, 2008 12:04 pm

denormalize seqential file data

Post by rahul.kissu »

plz solve this
I have file with 2 fields
state ZIPCODE
fg 500050
sn 677887
kk 789879
fg 578687
fg 587887
sn 687688

i need a output like

state zipcode count
fg 500050,578687,587887 3
sn 677887,687688 2
kk 789879 1
sunil
anbu
Premium Member
Premium Member
Posts: 596
Joined: Sat Feb 18, 2006 2:25 am
Location: india

Post by anbu »

Code: Select all

Sequential File --> Sort --> Transformer --> Remove Duplicates
Sort the data on state. In transformer store previous state and zipcode in stage variables and compare current row with previous stage variables. If the state is same append zipcode to current row and increment the count.
Use remove duplicates and sort ascending on state, count and retain last.
You are the creator of your destiny - Swami Vivekananda
rahul.kissu
Participant
Posts: 6
Joined: Tue Sep 09, 2008 12:04 pm

Post by rahul.kissu »

please explain transformer derivation in more details
sunil
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Question: Sunil, are you marketing yourself as a DataStage practitioner?

The technique here is "vertical pivot". Details may be found if you
Search DSXchange.

If you want folks to provide complete solutions, chances are that they'll want to be paid. Because they, not you, will have done the consulting work.
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