Hi All
I need to extract the header of the file and its detail records separately and do some validations and after that again I need to merge them together.
Soure data
-------------
ID|COUNTRY_ID|F2400|F2500|F2600
101|1|1001|1002|1003
102|2||1004|1006
103|3|1005||1008
I want to extract the header and do some validations and after that again I need to merge the header with the detail records..
Pls Help me......
Kind Regards
How to extract Header and Detail Records separately
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 30
- Joined: Tue Feb 19, 2008 11:02 pm
Re: How to extract Header and Detail Records separately
Just put a condition to check if if first two characters are ID
-
- Participant
- Posts: 30
- Joined: Tue Feb 19, 2008 11:02 pm
-
- Premium Member
- Posts: 28
- Joined: Tue Jul 01, 2008 9:23 am
Re: How to extract Header and Detail Records separately
I have faced similar issue before. We resolved using the Stage varibles in Transformation stage.
It will loop till we have next occurance of Header ID.
Or you have Transformer Stage filter thru constraints check for header ID occurance.
Try any of the solution.
Rgds,
Chakradhar.
It will loop till we have next occurance of Header ID.
Or you have Transformer Stage filter thru constraints check for header ID occurance.
Try any of the solution.
Rgds,
Chakradhar.
-
- Premium Member
- Posts: 28
- Joined: Tue Jul 01, 2008 9:23 am
Re: How to extract Header and Detail Records separately
Next simple solution is write a Unix Script , you can make 2 files like header and detail files and process them separetely. It is quite simple compared to dataStage job.
Rgds,
Chakradhar.
Rgds,
Chakradhar.
Re: How to extract Header and Detail Records separately
looking at the data it feels like your header is an record that starts with an value "ID" check for that and then move it to an different link using an transformer, do the same with your Trailer record.Could be done using a Transformer and defining appropriate constraints in it.