DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
This topic has been marked "Resolved."
Author Message
chakkara
Participant



Joined: 28 Jun 2018
Posts: 5

Points: 56

Post Posted: Thu Jun 28, 2018 7:20 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Unix
Hi All,

I have a requirement to copy header count and paste it in its detail records.I need logic to create col4 based on header.

I tried splitting header and detail records and did left outer join with detail record link as primary. I did find duplicates and it got cross joined.

Note : My file contains multiple headers and detail record count will present at individual headers

Sample Input :

Col1 Col2 Col3
H 2 A
D 1 A
D 2 A

H 3 A
D 1 A
D 2 A
D 3 A

H 4 A
D 1 A
D 2 A
D 3 A
D 4 A


Expected Output :

Col1 Col2 Col3 Col4
H 2 A
D 1 A 2
D 2 A 2

H 3 A
D 1 A 3
D 2 A 3
D 3 A 3

H 4 A
D 1 A 4
D 2 A 4
D 3 A 4
D 4 A 4

Thanks in advance.
chakkara
Participant



Joined: 28 Jun 2018
Posts: 5

Points: 56

Post Posted: Fri Jun 29, 2018 9:31 pm Reply with quote    Back to top    

Please help me and provide permanent solution to handle this requirement.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42665
Location: Denver, CO
Points: 219727

Post Posted: Fri Jun 29, 2018 10:47 pm Reply with quote    Back to top    

Exclamation Patience, Grasshopper. People help when and if they can and they will provide guidance - it's up to you for the "permanent solution" part.

A bit old but since I've done much the same thing and written it up before, managed to find this post which has some thoughts on approaching this. Hope it helps.

_________________
-craig

And I'm hovering like a fly, waiting for the windshield on the freeway...
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54284
Location: Sydney, Australia
Points: 294434

Post Posted: Mon Jul 02, 2018 1:34 am Reply with quote    Back to top    

So this is marked as resolved.

I presume you learned about how to use stage variables to "remember" things.

Do let us know.

Oh, and by the way, not everyone spends the whole weekend logged in to DSXchange!

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours