Page 1 of 1

Comparing TIMESTAMP in Sort

PostPosted: Thu Jun 11, 2015 11:47 am
by sganja
Hi All,

I am having a flat file as in below format where its holding a key value in first 10 bytes. For Each key value there will be chance of 1 or 2 Records followed by 99 series and 88 series. in some scenarios for a key field same time stamp got recorded which is creating issue while pulling based on ( key + timestamp ).

I want to filter out the records which key field is having same time stamp.

8888888888 9933333333 2012-02-17-08.12.05.671002
8888888888 8833333333 2012-02-17-08.12.05.671002
9999999999 9933333333 2012-02-18-07.11.08.123456
9999999999 8833333333 2011-02-18-07.11.08.123456
7777777777 9933333333 2012-02-17-00.12.05.671002
7777777777 8833333333 2010-02-17-00.12.05.671002
5555555555 9933333333 2012-02-20-00.12.05.671002
5555555555 8833333333 2012-02-20-00.12.05.671002
4444444444 9933333333 2012-06-20-06.30.05.543621
4444444444 8833333333 2013-06-20-06.30.05.543621
3333333333 8833333333 2011-06-20-06.30.05.543621
2222222222 8833333333 2013-06-20-11.30.05.543621
1111111111 8933333333 2013-06-20-06.30.05.543621
6666666666 8833333333 2013-06-20-06.30.05.543621


I am using DFSORT as below
SORT FIELDS=(1,10,CH,A)
SUM FIELDS=()

Whats to give in () to filter the same time stamp fields. Can Some one help here how to approach this.

Thanks,

Re: Comparing TIMESTAMP in Sort

PostPosted: Thu Jun 11, 2015 1:33 pm
by enrico-sorichetti
your explanation is clear as mud ...

show what is the expected output data
for the the input data You posted

and use the code tags to keep data aligned

Re: Comparing TIMESTAMP in Sort

PostPosted: Thu Jun 11, 2015 2:00 pm
by BillyBoyo
Do you want to SORT the records? You have duplicate timestamps across keys. Is that OK?

Re: Comparing TIMESTAMP in Sort

PostPosted: Thu Jun 11, 2015 2:44 pm
by sganja
Hi All

I want to write the records to separate file which have duplicate timestamps across keys.
Input file:
8888888888 9933333333 2012-02-17-08.12.05.671002
8888888888 8833333333 2012-02-17-08.12.05.671002
9999999999 9933333333 2012-02-18-07.11.08.123456
9999999999 8833333333 2011-01-15-07.11.08.123456
7777777777 9933333333 2012-02-17-00.12.05.671002
7777777777 8833333333 2010-02-17-00.12.05.671002
5555555555 9933333333 2012-02-20-00.12.05.671002
5555555555 8833333333 2012-02-20-00.12.05.671002
4444444444 9933333333 2012-06-20-06.30.05.543621
4444444444 8833333333 2013-11-30-06.30.05.543621
3333333333 8833333333 2011-06-20-06.30.05.543621
2222222222 8833333333 2013-06-20-11.30.05.543621
1111111111 8933333333 2013-06-20-06.30.05.543621
6666666666 8833333333 2013-06-20-06.30.05.543621


Expected output:
8888888888 9933333333 2012-02-17-08.12.05.671002
8888888888 8833333333 2012-02-17-08.12.05.671002
5555555555 9933333333 2012-02-20-00.12.05.671002
5555555555 8833333333 2012-02-20-00.12.05.671002



thanks,

Re: Comparing TIMESTAMP in Sort

PostPosted: Thu Jun 11, 2015 5:38 pm
by sganja
I am able to complete it. Thank you all for your time spent.