| The following age-old trick allows you to do multiple key sorts:
BIND/SORT=".least-significant-field" *phantom1 TO dataset
BIND/SORT=".most-significant-field" *phantom2 TO *phantom1
In your case, the first bind should sort on the given name, and the second bind
should sort on the surname. You can extend it to sort on any number of fields,
as long as the sorts are done in order from least significant to most
significant field. If the dataset is large and you only want part of it, a
WITH RSE clause on the first BIND will (should?) stop subsequent binds sorting
records you don't want, and thus improve performance.
I just tried it with PROFIL and it works fine, but SUBSCRIBER is a funny beast
so I make no guarantees!
Oh, one other point; this method relies on the sorting algorithm being stable
(ie the sort doesn't change the ordering of records with identical keys; fyi,
mergesort is stable, quicksort isn't...) Unfortunately, the algorithm used by
BIND isn't stable, so it won't always give the right result, but it's better
than not doing anything!
Scott
|
|
Correct me if I'm wrong, but I was under the distinct impression that
this functionality was supported:
BIND/SORT=".most .least" *phantom to dataset
Of course, this will do a TRIM on each field so you may need to put in
field lengths.
Note also that the magic "@" operator also works:
BIND/SORT="@'expression'" *phantom to dataset
where expression can be another data-set reference. This allows a form
of JOIN and PROJECTION operation because you can also use this in the
WITH clause.
Paul.
|
| So "they" weren't happy with the mods I made (were it just sorts into
Surname order). If this is the customer I think it is you could have a
job for life - they'll come up with another request now, at least it'
more money for DEC :-)
.Steve.
BTW. Due to "reprofiling", experienced specialist for hire, so....
Any customers in the North UK looking for an experienced
ALL-IN-1/VMS System Manager in the next three months point
them in my direction.
|