IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Can we do sort on Timestamp filed


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Apr 16, 2012 7:12 pm
Reply with quote

Hello All,

I have a dataset to be sorted on Timestamp field.

Please let me know If we have any Sort condition which can do my requirement....

I searched in the forum to get the details.. Unfortunately i did not find any posts on filtering on Timestamps.

Awaiting for your responses.

Thanks,
Sravani.
Back to top
View user's profile Send private message
saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Mon Apr 16, 2012 7:18 pm
Reply with quote

Please provide following details

1. RECFM & LRECL of the file
2. Sample Input & Output
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2012 7:20 pm
Reply with quote

I don't know what you are having trouble with.

Code:
  SORT FIELDS=(start-of-timestamp,length-of-timestamp,CH,A)


EDIT: Looking again, you mention "filtering". As well as what Sai has asked for, please do let us know what processing you want to achieve "filtering" and "sorting" and anything else you need, all in one go, as clear as possible.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Apr 16, 2012 7:22 pm
Reply with quote

Whatever way the Timestamp is encoded, it's in a YYYYMMDDHHmmSSuuuuuu format and you can sort it as character.
Back to top
View user's profile Send private message
sravz chinnu

New User


Joined: 07 Dec 2011
Posts: 26
Location: India

PostPosted: Mon Apr 16, 2012 7:43 pm
Reply with quote

Bill Woodger wrote:
I don't know what you are having trouble with.

Code:
  SORT FIELDS=(start-of-timestamp,length-of-timestamp,CH,A)


EDIT: Looking again, you mention "filtering". As well as what Sai has asked for, please do let us know what processing you want to achieve "filtering" and "sorting" and anything else you need, all in one go, as clear as possible.


Really Apologize Bill without testing posting in the forum...

I was thinking we will have some specific datatype to be specified like ZD,PD etc...

It is working with my data and i got the below output.

Code:
9800061450279939|00000|2012-04-12-07.04.06.082316
9800061436508169|00000|2012-04-12-02.27.06.687805
9800067605664179|00000|2012-04-12-02.08.01.801228
9800042819731503|00001|2012-04-12-01.50.29.697251
9800067600132987|00000|2012-04-12-01.36.11.369361
9800060896021324|00000|2012-04-12-01.32.32.610814
9800067606617945|00000|2012-04-12-01.14.41.054780
9800029874359507|00000|2012-04-12-00.47.38.617897
9800061374828596|00000|2012-04-12-00.23.06.477832
9800061381222424|00000|2012-04-12-00.16.12.320081
9800061976728249|00010|2012-04-12-00.14.04.382675
9800062033907522|00000|2012-04-12-00.09.22.249470
9800062155232588|00010|2012-04-12-00.08.36.091684
9800021445056204|00000|2012-04-12-00.08.07.528737


Thanks alot for leting me know.

Sravani.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top