Sequential File stage
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
Sequential File stage
Hi..
I have a scenario where in I have to reading 4 files and transform them and then load it into a single file.
My problem is the job loads only data from one file. It doesn't throw any error but rather than loading 30 records each from 4 files it loads only data from one file. I have checked append to file option also.
Can anyone help me locate where I am going wrong.
I have a scenario where in I have to reading 4 files and transform them and then load it into a single file.
My problem is the job loads only data from one file. It doesn't throw any error but rather than loading 30 records each from 4 files it loads only data from one file. I have checked append to file option also.
Can anyone help me locate where I am going wrong.
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
Is there any similarity between the file names? If so then you can probably use a wild character to read all the files. Example f1.txt, f2.txt, f3.txt. then you can use f*.txt. But for this the meta data for the files should be the same. Just make sure there are no other files in the folder with the same name pattern.
"I have checked append to file option also" This is in the target. but your problem is in the source stage. Try this and see if it will work.
"I have checked append to file option also" This is in the target. but your problem is in the source stage. Try this and see if it will work.
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
sorry ..
![Embarassed :oops:](./images/smilies/icon_redface.gif)
I have four sequential file to read data from 4 files. Each file I apply different transformation and output from the transformer is sent to a single file stage.
4 sequential file stage(Input) --> 4 transformer stage (for each file)--->1 sequential file stage(output)
My problem is my final output sequential file has data only from the one file.
Hope I am clear now![Shocked :shock:](./images/smilies/icon_eek.gif)
![Embarassed :oops:](./images/smilies/icon_redface.gif)
I have four sequential file to read data from 4 files. Each file I apply different transformation and output from the transformer is sent to a single file stage.
4 sequential file stage(Input) --> 4 transformer stage (for each file)--->1 sequential file stage(output)
My problem is my final output sequential file has data only from the one file.
Hope I am clear now
![Shocked :shock:](./images/smilies/icon_eek.gif)
That's what I was afraid of. You need to understand that sequential files need to be accessed sequentially, it's the nature of the beast. This means while a sequential file can support multiple reader processes, it can only support a single writer process.
This is not a 'DataStage restriction', it is a sequential file restriction regardless of platform or application. You may end up with one file's worth or a mixture in your output file when all is done, and the setting of the 'Append' option doesn't help here at all.
So, you'll either need to process the four files one at a time and append each to the previous one or write to four different files and then concatenate the results together 'after job' to build your final file.
ps. The latter is a very typical solution to this 'problem' and is the easiest to arrange.
This is not a 'DataStage restriction', it is a sequential file restriction regardless of platform or application. You may end up with one file's worth or a mixture in your output file when all is done, and the setting of the 'Append' option doesn't help here at all.
So, you'll either need to process the four files one at a time and append each to the previous one or write to four different files and then concatenate the results together 'after job' to build your final file.
ps. The latter is a very typical solution to this 'problem' and is the easiest to arrange.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
That can work as well. I tend to forget out the 'Link' stages, the Collector will allow the creation of your single writer process. I find the extra overhead of needing to use the 'Sort/Merge' option if you care about the output order to not be worth it, however.
But that's a personal preference. Use whatever works for you.
But that's a personal preference. Use whatever works for you.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm
-
- Participant
- Posts: 467
- Joined: Tue Mar 20, 2007 6:36 am
- Location: Chennai
- Contact:
Click on the job properties and..
In the Job properties ........
Uncheck the Project defaults checkbox
And click on the second radio button.. (I think it's Inter process)
Then the compilation warning should go away.
In the Job properties ........
Uncheck the Project defaults checkbox
And click on the second radio button.. (I think it's Inter process)
Then the compilation warning should go away.
Minhajuddin
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
<a href="http://feeds.feedburner.com/~r/MyExperi ... ~6/2"><img src="http://feeds.feedburner.com/MyExperienc ... lrow.3.gif" alt="My experiences with this DLROW" border="0"></a>
-
- Participant
- Posts: 33
- Joined: Sun Jun 24, 2007 9:46 pm