Hi,
I have a source text file which has 10 recs and I am having a few transformations in the middle and putting the output to a sequential file again having 10 recs. Is there any way I can write only the last record i.e. the 10th record to the file.
Thanks,
Reading or writing the last record to a Sequential File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Reading or writing the last record to a Sequential File
check for @OUTROWNUM and mod function. But please beware, when you use parallel jobs, then your definition of 10th record is no more valid.durgaps wrote:Hi,
I have a source text file which has 10 recs and I am having a few transformations in the middle and putting the output to a sequential file again having 10 recs. Is there any way I can write only the last record i.e. the 10th record to the file.
Thanks,
example:-
Select the 10th record from a given table.
10th record can be the physical location, the 10th record from your data buffer, or may be the 10th record after sorting by date
you may also want to try @PARTITIONNUM and @NUMPARTITIONS to define your 10th record
-
- Participant
- Posts: 74
- Joined: Sat Jul 08, 2006 4:09 am
- Location: Melbourne, Australia
- Contact:
Re: Reading or writing the last record to a Sequential File
Hi Ray,prabu wrote:check for @OUTROWNUM and mod function. But please beware, when you use parallel jobs, then your definition of 10th record is no more valid.durgaps wrote:Hi,
I have a source text file which has 10 recs and I am having a few transformations in the middle and putting the output to a sequential file again having 10 recs. Is there any way I can write only the last record i.e. the 10th record to the file.
Thanks,
example:-
Select the 10th record from a given table.
10th record can be the physical location, the 10th record from your data buffer, or may be the 10th record after sorting by date
you may also want to try @PARTITIONNUM and @NUMPARTITIONS to define your 10th record
Thanks for the reply. I am using parallel extender and I dont find the LAST function in AGGREGATOR stage
Durga Prasad
-
- Participant
- Posts: 22
- Joined: Thu Jun 02, 2005 5:12 am
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
-
- Charter Member
- Posts: 199
- Joined: Tue Jan 18, 2005 2:50 am
- Location: India