U can split on the basis of the @INROWNUM System variable.
In the transformer put constraints on the above variable for the two links.
To split a Sequential File in to two horizantally
Moderators: chulett, rschirm, roy
That assumes, of course, that you know the number of rows coming in. If you don't, you are going to need to do something to capture that number (assuming that it is a variable) and send it in to your job. You could write a job to count the rows and pass that information, suitably divided, to the splitting job. On Unix, you can take advantage of commands launched by Job Control to do "wc -l" on the file to get the number of records. Depending on what needs to happen with the two files, you could script something using both "wc" and "split" and then process the split files with DataStage.
As they say, more than one way to skin a cat.
-craig
As they say, more than one way to skin a cat.
-craig
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
I think ray has explained the first part of it
What i meant by splitting with the help of @INROWNUM is something like in one link in transformer the constraint would be @INROWNUM < 500 and in another @INROWNUM >=500....Now if plan to split it exactly into two with the no. of records unkown first u need to get the count of records which if u are not comfortable with routines might look in two jobs :
1) in this job u will count the no. of records with the help of aggregator possibly then pass a parameter(VALUE) to next job with this count
2) in the other job ur constraints might be like < Value/2 and >=Value/2 which is as told by ray earlier only.
But if u are just trying to split based on the way the way the i/p sequential file is coming then whatz the second part of the question u are asking?[?]
What i meant by splitting with the help of @INROWNUM is something like in one link in transformer the constraint would be @INROWNUM < 500 and in another @INROWNUM >=500....Now if plan to split it exactly into two with the no. of records unkown first u need to get the count of records which if u are not comfortable with routines might look in two jobs :
1) in this job u will count the no. of records with the help of aggregator possibly then pass a parameter(VALUE) to next job with this count
2) in the other job ur constraints might be like < Value/2 and >=Value/2 which is as told by ray earlier only.
But if u are just trying to split based on the way the way the i/p sequential file is coming then whatz the second part of the question u are asking?[?]
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: