I have a file in this format.
.........P1 P2 P3............................
A001 v11 v21 v31.......................
A002 v12 v22 v32.......................
A003 v13 v23 v33.......................
A004 v14 v24 v34.......................
.................................................
.................................................
.................................................
A00n
This has to be flattened in this format
A001 P1 v11
A001 P2 v21
A001 P3 v31
A001 P4 v41
...
...
...
Please let me know if there is a good way to do it in Datastage (Server Ed.) or should I use AWK to do it?
Kumar
Convert Pivot to Flat file
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This is what's called a horizontal pivot and is exactly what the Pivot stage is intended to do.
Look in your manuals for Pivot.pdf which explains how to use it, with examples.
Search the forum for an example of pivoting the constants (P1 through P4).
Look in your manuals for Pivot.pdf which explains how to use it, with examples.
Search the forum for an example of pivoting the constants (P1 through P4).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.