Usenet comp.sys.vms (1990-2004)
 help / color / mirror / Atom feed
From: "joe huber" <jhuber@monmouth.com>
Subject: Re: sorting by date/time with DIRECTORY or SORT command
Date: 1998/02/25	[thread overview]
Message-ID: <6d18qk$6n6$1@news.monmouth.com> (raw)
In-Reply-To: 6cvet0$dt2$1@nnrp1.dejanews.com



splat@cfu-cybernet.net wrote in message <6cvet0$dt2$1@nnrp1.dejanews.com>...
>
>I am also interested in DCL commands and SORT/MERGE specification files
that
>will allow me to manipulate records with a date/time key.


Sorting a list of dates is strait forward enough. Supposing
a file containing a list of dates (something along the lines of):

01-JAN-1998
25-MAR-1945
05-SEP-1999

a specification file to do the trick would run as follows:

(order.srt)

/collating_sequence=(sequence=
    "AN","EB","AR","PR","AY","UN","UL",
    "UG","EP","CT","OV","EC","0"-"9"),
    modification=(" "="0"),
    fold)
/field=(name=year,pos:8,siz:4)\
/field=(name=month,pos:4,siz:3)
/field=(name=day,pos:1,siz:2)
/key=year
/key=month
/key=day

Assuming the above dates are in a file called dates.dat a

    $ sort/spec=order.srt dates.dat sys$output

would list them in sorted order on your terminal.

//  like a bird in a cage, spreading its wings to fly
//  'the old ways are lost' you sang as you flew
//  and I wondered why
//
//      The Old Ways (Loreena McKennitt)
//
// Joe Huber        jhuber@monmouth.com





  reply	other threads:[~1998-02-25  5:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-24  5:00 sorting by date/time with DIRECTORY or SORT command splat
1998-02-25  5:00 ` joe huber [this message]
1998-03-06  5:00 ` Arthur E. Ragosta
1998-03-07  5:00   ` Phillip Helbig
1998-03-12  5:00     ` Simon McClenahan
1998-03-12  5:00       ` Arthur E. Ragosta
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox