a complex requirment.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
a complex requirment.
Hi,
I have a complex requirment.
I have records like:
id Fe Zn Ag
1 10 20 30
2 5 6 8
Now I want the records like:
id test value
1 Fe 10
1 Zn 20
1 Ag 30
2 Fe 5
2 Zn 6
2 Ag 8
Can we do that in Datastage.....Please help...
Regards,
Arnie.
I have a complex requirment.
I have records like:
id Fe Zn Ag
1 10 20 30
2 5 6 8
Now I want the records like:
id test value
1 Fe 10
1 Zn 20
1 Ag 30
2 Fe 5
2 Zn 6
2 Ag 8
Can we do that in Datastage.....Please help...
Regards,
Arnie.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use stage variables to store the distinct column headers from the first row, i.e. SvarCol2 is "IF NOT(In.Col2) THEN In.Col2 ELSE SvarCol2". Then derive your output columns from the data and your stage variables. Manually add a line terminator after the column value and write to a sequential file or use the pivot stage to split the rows.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 101
- Joined: Mon Aug 13, 2007 2:32 am
My stage variable response also applies when you use the pivotr stage.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>