Operating System - OpenVMS
Showing results for 
Search instead for 
Did you mean: 

undocumented CLD/CLI$ features

Jess Goodman
Esteemed Contributor

undocumented CLD/CLI$ features

In the thread:

Hein gives this SORT command line solution:
$ 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)

That command line works, but compels me to point out a curious thing about the SORT verb. In other DCL verbs if you use the same qualifier on the command line more than once, only the last use of it counts. For instance:
displays printer, not terminal, queue types.

SORT doesn't use CLI$GET_VALUE('KEY'... because that would return only the keywords attached to the last instance of /KEY= on the command line. It would be possible for it to use CLI$GET_VALUE('$LINE'.. to get the whole command line and then parse all the /KEY=s itself, but I don't think it does that either, because the string $LINE is not present in SORTMERGE.EXE.

Anyone with VMS source know how SORT does this? I would love to know about any undocumented features of the CLI$ routines.

I would also love to know the details about all of the undocumented CLD built-in value types and the checks/conversions done for all of the built-in types (for example what is the difference between using type=$file, $infile, or $outfile ?)
I have one, but it's personal.
Hein van den Heuvel
Honored Contributor

Re: undocumented CLD/CLI$ features

Ah, well spotted.
SORTMERGE is the exception.

Not too many public references on that.
But comp.os.vms probably has enough for you:

Try this:



Hein van den Heuvel
HvdH Performance Consulting
Richard Whalen
Honored Contributor

Re: undocumented CLD/CLI$ features

I'm not sure what my company's source license allows me to say.

From my quick reading of the BLISS listing it looks like SORT uses a call that is documented in the utilities routine manual to get each qualifier in turn and does its own processing of the qualifier.
John Gillings
Honored Contributor

Re: undocumented CLD/CLI$ features


My recollection is this feature was specially created for SORT to implement the /KEY qualifier. Nothing else uses it, and it's not documented or supported for "ordinary" users of CLD.

>(for example what is the difference
>between using type=$file, $infile, or
>$outfile ?)

All check that the object is a valid filespec prior to activating the image. I think the intention may be more for self documentation in the CLD than anything else. A rudimentary test didn't find any differences (I thought maybe "$outfile" would prevent wildcards, or $infile would have to exist, but they don't seem to make any difference).

I guess you need to go hunting in the sources. Note that even a very old results disk would be sufficient - maybe you can get hold of someone's cast off?
A crucible of informative mistakes
Peter Quodling
Trusted Contributor

Re: undocumented CLD/CLI$ features

cast off results disk - now that would be a find...

Leave the Money on the Fridge.