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
seanirs
Participant



Joined: 29 Dec 2017
Posts: 3

Points: 41

Post Posted: Fri Dec 29, 2017 12:43 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Unix
My data is like below in one column coming from a file. There is customer information and every customer can have one meter or many meters and every meter will have atleast one reading or many. every meter may or may not have a meter statement. if meter statement is absent then pad 100 spaces. below is the sample data. there is only one column in the complete file and no other columns and no other way to tie to those meters and readings to the parent customer. just follow the order in sequence.

Source_data---(This is column name)
CUSTOMER 15
METER 8
METERStatement 1
READING 1
METER 56
Meterstatement 17
Reading 5
Reading 6
Reading 7
CUSTOMER 38
METER 24
METERStatement 1
READING 51
CUSTOMER 77
METER 38
READING 9

I want the output data to be like below in one column

CUSTOMER 15 METER 8 METERStatement 1 READING 1
CUSTOMER 15 METER 56 Meterstatement 17 Reading 5
CUSTOMER 15 METER 56 Meterstatement 17 Reading 6
CUSTOMER 15 METER 56 Meterstatement 17 Reading 7
CUSTOMER 38 METER 24 Meterstatement 1 Reading 51
CUSTOMER 77 METER 38 'pad 100 spaces' Reading 9

I am trying to solve by reading transformer looping documentation but could not figure out an actual solution. anything helps. thank you all.

_________________
sean

Last edited by seanirs on Fri Dec 29, 2017 1:38 pm; edited 1 time in total
Mike



Group memberships:
Premium Members

Joined: 03 Mar 2002
Posts: 1017
Location: Omaha, NE
Points: 6551

Post Posted: Fri Dec 29, 2017 1:18 pm Reply with quote    Back to top    

I don't see any need for transformer looping. It looks to me like you can do everything with stage variables and output constraints.

Mike
Rate this response:  
seanirs
Participant



Joined: 29 Dec 2017
Posts: 3

Points: 41

Post Posted: Fri Dec 29, 2017 1:26 pm Reply with quote    Back to top    

could you please elaborate for me...

_________________
sean
Rate this response:  
Not yet rated
seanirs
Participant



Joined: 29 Dec 2017
Posts: 3

Points: 41

Post Posted: Fri Dec 29, 2017 1:39 pm Reply with quote    Back to top    

There is customer information and every customer can have one meter or many meters and every meter will have atleast one reading or many. every meter may or may not have a meter statement. if meter statement is absent then pad 100 spaces. below is the sample data. there is only one column in the complete file and no other columns and no other way to tie to those meters and readings to the parent customer. just follow the order in sequence

_________________
sean
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: 54294
Location: Sydney, Australia
Points: 294490

Post Posted: Fri Dec 29, 2017 8:28 pm Reply with quote    Back to top    

I, too, would resolve this purely using stage variables. You need an output link constraint expression to determine when to generate an output row (e.g. when the input is a READING row).

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne
Rate this response:  
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