Hi,
I am trying to Read and Write to same sequential file (i am overwriting the sequential file on Target side). But it fails as it is not reading from the file.
But my observation is, if i change the filename on the target side it is reading data from the file and writing to new file.
Any help would be highly appreciated.
Thanks,
naren
Reading and Writing to same sequential file
Moderators: chulett, rschirm, roy
-
- Premium Member
- Posts: 457
- Joined: Tue Sep 25, 2007 4:05 pm
Re: Reading and Writing to same sequential file
It is quite obvious that once you open a file, you can write to it. You just try doing it manually on a Windows machine and see if you can do it. If you cannot, then this would extend to the tool too.naren6876 wrote:Hi,
I am trying to Read and Write to same sequential file (i am overwriting the sequential file on Target side). But it fails as it is not reading from the file.
But my observation is, if i change the filename on the target side it is reading data from the file and writing to new file.
Any help would be highly appreciated.
Thanks,
naren
A solution to your problem is to write to another file and use another job OR a Unix command to rename the file back to the original name.
Vivek Gadwal
Experience is what you get when you didn't get what you wanted
Experience is what you get when you didn't get what you wanted
-
- Participant
- Posts: 29
- Joined: Wed Jan 06, 2010 7:18 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Premium Member
- Posts: 1044
- Joined: Wed Sep 29, 2004 3:30 am
- Location: Nottingham, UK
- Contact:
If what you want to do is read all the data in from a file, apply some processing, and then write the data back out to the file, then that isn't really what DataStage jobs do. They don't hold data sets in memory, they typically process just one row at a time. You need to store the data somewhere while the transformation is being applied, and then write it back to the original file afterwards.
You can read the original file, pass through a Transformer, back out to a temporary file, and then have another link coming out of the temporary file and in to another Sequential File with the original name. That will do what you want to do in one job, but does involve landing the data into a temporary file. Or you can do the delete/rename thing mentioned by others.
You can read the original file, pass through a Transformer, back out to a temporary file, and then have another link coming out of the temporary file and in to another Sequential File with the original name. That will do what you want to do in one job, but does involve landing the data into a temporary file. Or you can do the delete/rename thing mentioned by others.
Phil Hibbs | Capgemini
Technical Consultant
Technical Consultant