How can I process squential files in date order?
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 148
- Joined: Thu Apr 10, 2008 12:47 am
How can I process squential files in date order?
Hello Mentors,
I have asked to design a job where 3 files are kept on server , now i have to form a loop through which oldest file should come first, then newest and then the most recent.
how could one do it in datastage??
i am afraid of any looping logic other than job sequencer?
Regards,
Devesh
[*Note - Title changed to be more descriptive - Andy*]
I have asked to design a job where 3 files are kept on server , now i have to form a loop through which oldest file should come first, then newest and then the most recent.
how could one do it in datastage??
i am afraid of any looping logic other than job sequencer?
Regards,
Devesh
[*Note - Title changed to be more descriptive - Andy*]
Re: Job designe
What exactly you are doing with the files, just moving or extracting ???devesh_ssingh wrote: i have to form a loop through which oldest file should come first, then newest and recent.
Regards,
Devesh
RAJ
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Why do you need a loop? Sort the files into date order (for example using an ls -lrt command) and use that result as the command line for a cat command. For example Use that as the Filter command in a Sequential File stage.
If the file names don't all fit on one line, adjust the Filter command appropriately - you may need to use a for loop therein.
Code: Select all
cat `ls -lrt /path/filepattern`
If the file names don't all fit on one line, adjust the Filter command appropriately - you may need to use a for loop therein.
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: 148
- Joined: Thu Apr 10, 2008 12:47 am
@ray
i have to achive this in datastage.
purpose is to get the data extracted to 3 datasets...for every new data
again new files.
the source file will be replaced in next run and have to extract to new dataset like in codes...
for( i=1, i<=3)
{
srci--->copy--->ds1
}
endloop;
src will be picked based on descending timestamp...
oldest to newset...
i donno how to loop somthing like this in datastage...can we acheived it by sequencer any mean...
i hope this give more clear picture
i have to achive this in datastage.
purpose is to get the data extracted to 3 datasets...for every new data
again new files.
the source file will be replaced in next run and have to extract to new dataset like in codes...
for( i=1, i<=3)
{
srci--->copy--->ds1
}
endloop;
src will be picked based on descending timestamp...
oldest to newset...
i donno how to loop somthing like this in datastage...can we acheived it by sequencer any mean...
i hope this give more clear picture
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
My answer, had you been able to read it all, IS in DataStage.
Premium membership is not expensive, at less than 30c (Rs12) per day, and well worth the investment.
Premium membership is not expensive, at less than 30c (Rs12) per day, and well worth the investment.
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: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: