DataStage coulmn merge
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 13
- Joined: Thu Jun 16, 2005 6:44 am
DataStage coulmn merge
Hi all anyone can help me with this ?
I have 2 sequential files (csv) with this structure...
1) File structure : key_col,colA,colB,colC
2) File structure : key_col,colD,colE
I need to import the records in these files in an Informix table with this structure merging the records with the same key_col values
3) Informix table structure :
key_col,colA,colB,colC,colD,colE
Exmaple :
1) 10,vala,valb,valc
20,vala1,valb1,valc1
2) 10,vald,vale
3) 10,vala,valb,valc,vald,vale
20,vala1,valb1,valc1,<null>,<null>
Is it possible doing that with merge stage or link collector stage ?
ThanX in advance Marco
I have 2 sequential files (csv) with this structure...
1) File structure : key_col,colA,colB,colC
2) File structure : key_col,colD,colE
I need to import the records in these files in an Informix table with this structure merging the records with the same key_col values
3) Informix table structure :
key_col,colA,colB,colC,colD,colE
Exmaple :
1) 10,vala,valb,valc
20,vala1,valb1,valc1
2) 10,vald,vale
3) 10,vala,valb,valc,vald,vale
20,vala1,valb1,valc1,<null>,<null>
Is it possible doing that with merge stage or link collector stage ?
ThanX in advance Marco
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 13
- Joined: Thu Jun 16, 2005 6:44 am
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
Hi Marco,
You can use File structure1 as input and the File structure2 as lookup (using hash file)
Read the File structure2 from the source (.csv) file into a hash file
and then use this hash file as a lookup for File structure1 (Input) and if y ou find a match on the Key_col, then transfer all the required columns to the target.
I hope this will get you started.
You can use File structure1 as input and the File structure2 as lookup (using hash file)
Read the File structure2 from the source (.csv) file into a hash file
and then use this hash file as a lookup for File structure1 (Input) and if y ou find a match on the Key_col, then transfer all the required columns to the target.
I hope this will get you started.
-
- Participant
- Posts: 13
- Joined: Thu Jun 16, 2005 6:44 am
-
- Participant
- Posts: 232
- Joined: Sat May 07, 2005 2:49 pm
- Location: USA
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 13
- Joined: Thu Jun 16, 2005 6:44 am
...but inner join extratcs only rows matching the key (as SQL inner join does)........ I need to have all rows in file A and all rows in file B with columns values merged for same key values as I explained in the example.....
I've seen I don't have Lookup Stage in my version I'll try to handle it with HashFile as pnchowdary suggested...
any other suggestion will be appreciated... ThnXX MarK
I've seen I don't have Lookup Stage in my version I'll try to handle it with HashFile as pnchowdary suggested...
any other suggestion will be appreciated... ThnXX MarK
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom