- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: SORTing a VMS file as per time stamp
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 09:47 PM
тАО02-04-2007 09:47 PM
Please guide me on how to sort the file as per time stamp in descending order. I am atttaching a sample file for this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 10:04 PM
тАО02-04-2007 10:04 PM
Re: SORTing a VMS file as per time stamp
sort /key=(pos:39,siz=19) a.tmp b.tmp
You have the sorted file in b.tmp
$ Help sort
will give you more information.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 10:15 PM
тАО02-04-2007 10:15 PM
Re: SORTing a VMS file as per time stamp
After lookiing at your sample file, a straightforward observation: First correct the time/date format to yyyy-mm-dd:hh:mm:ss.
Changing the time information to the above format will allow the time/date information to be sorted as a single key. Then use a SORT command as Gerard stated in his post.
- Bob Gezelter, http://www.rlgsc.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 10:32 PM
тАО02-04-2007 10:32 PM
Re: SORTing a VMS file as per time stamp
Sin your date-stamp is NOT Year-month-day, you need to construct a multi-key SORT, for which you have to break-up your date-field.
As Gerard says:
$ HELP SORT
especially the /KEY paragraph is relevant here.
hth
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-04-2007 11:46 PM
тАО02-04-2007 11:46 PM
SolutionToo bad it was not yyyy-mm-dd:.... even easier!
Anyway to get several ideas:
google: +openvms +directory +sort "by date"
And of course, check HELP SORT/KEY as suggesed.
A recent entry here with tricky, textual, months:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1095459
Actual solution is probably:
$ sort/key=(pos:46,size:4,des)/key=(pos:43,siz:2,des)/key=(pos:40,siz:2,des)/key=(pos:51,siz:8,des)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-06-2007 12:11 AM
тАО02-06-2007 12:11 AM