Same sequential file as the source and the target
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 11
- Joined: Tue Nov 21, 2006 3:08 am
- Location: Pune
Same sequential file as the source and the target
Hi ,
I have a situation wherein I need to use the same Sequential file as the source , do some transformations and then load this data into the same sequential file which will have the updated data for the next run.
Please help...
I have a situation wherein I need to use the same Sequential file as the source , do some transformations and then load this data into the same sequential file which will have the updated data for the next run.
Please help...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You're in a very bad situation, then. How would you do it with any other software? Seriously - all you can do is write to a temporary file then, once the job has completed, delete the source file and rename the temporary file. Or use different directories.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 11
- Joined: Tue Nov 21, 2006 3:08 am
- Location: Pune
-
- Participant
- Posts: 36
- Joined: Mon Jul 16, 2007 3:37 am
- Location: USA
Re: Same sequential file as the source and the target
Create 2 jobs ,in first job take one temporary file as target and use same file as source in next job and load into u r original sequential file.prajish_ap wrote:Hi ,
I have a situation wherein I need to use the same Sequential file as the source , do some transformations and then load this data into the same sequential file which will have the updated data for the next run.
Please help...
VINOD
-
- Participant
- Posts: 11
- Joined: Tue Nov 21, 2006 3:08 am
- Location: Pune
Re: Same sequential file as the source and the target
reddy.vinod wrote:Create 2 jobs ,in first job take one temporary file as target and use same file as source in next job and load into u r original sequential file.prajish_ap wrote:Hi ,
I have a situation wherein I need to use the same Sequential file as the source , do some transformations and then load this data into the same sequential file which will have the updated data for the next run.
Please help...
... thanks.... ...but i need to do this in a single job.
What the responders have alluded to, but not stated explicitly, is that a sequential cannot be read from and written to at the same time. This has nothing at all to do with DataStage but is an inherent limitation of the sequential file type on all operating systems.
So the suggestions all try to work around that limitation in some manner. I like renaming the original file from X to Y and then writing output from the DataStage job to X, then deleting the file Y when the job finishes successfully. There are many variations on this theme possible. You can use the Before and After job subroutine calls to perform these renaming and deleting options.
So the suggestions all try to work around that limitation in some manner. I like renaming the original file from X to Y and then writing output from the DataStage job to X, then deleting the file Y when the job finishes successfully. There are many variations on this theme possible. You can use the Before and After job subroutine calls to perform these renaming and deleting options.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 11
- Joined: Tue Nov 21, 2006 3:08 am
- Location: Pune
Thanks ...I thought of using the Before and After job subroutine calls to perform the renaming and deleting the file ...but I was told that this can be achieved in some other way too ... So I thought may be if anybody has a different way of working towards this could suggest the same... anyways thank you all for the help ...ArndW wrote:What the responders have alluded to, but not stated explicitly, is that a sequential cannot be read from and written to at the same time. This has nothing at all to do with DataStage but is an inherent limitation of the sequential file type on all operating systems.
So the suggestions all try to work around that limitation in some manner. I like renaming the original file from X to Y and then writing output from the DataStage job to X, then deleting the file Y when the job finishes successfully. There are many variations on this theme possible. You can use the Before and After job subroutine calls to perform these renaming and deleting options.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Well, of course it COULD be done. But you'd only be doing with DataStage what we've already advised.
would work
Code: Select all
SeqFileA -----> SeqFileB -----> SeqFileA
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Same sequential file as the source and the target
you can do this by after job subroutine.
sequentiale fileA---------->transformer--------->temp file
cat temp file>sequentialfileA .
if your satisfied reply .
sequentiale fileA---------->transformer--------->temp file
cat temp file>sequentialfileA .
if your satisfied reply .
suman