Inside VESOFT #07 (Handy Oddballs)
by
Shawn M. Gordon

I think there is offically 3 bazillion commands and possibilities in the VESOFT suite of products, so it can at times be easy to miss some feature that you would find useful. Part of the purpose of this column is to bring these little gems to your attention so that you might make use of them at some point. The purpose of this months column is to share some of the more esoteric commands.

First let’s talk about ALIAS, and its companion command UNALIAS. I remember this came about while I was working at VESOFT. We had just gotten a Unix machine in, and we found this and thought it was pretty useful, so we came up with a kludge to implement it. Eventually it got cleaned up and made part of MPEX.

Essentially an ALIAS is a quick way to do something like a UDC or a command file. They have the advantage that they can apply only to you, they can be turned on and off at will, and can also be added to your MPEXMGR file. They can take a parameter after a fashion, essentially you can pass the right part of the command as a parameter, it just appends it to the alias. An alias can only be one line, and you can’t put logic in it (well you can sort of do it, but it’s convoluted). It’s probably good to show some examples.

Here is a simple example that is usually a UDC:

%ALIAS SS SHOWJOB JOB=@S

Now you can just type SS and you will get a list of sessions. Perhaps you want to make the session or job portion a parameter, then you would do:

%ALIAS S SHOWJOB JOB=@

Now you could type “S J” or “S S” to show jobs or sessions respectively.

To remove the alias, simply type:

%UNALIAS S

A better example of the ad-hoc nature of an Alias would be when you are testing a program and have some long run command to issue. You can just make an alias of it and save yourself some typing, for example:

%ALIAS TESTIT RUN MYPROG;INFO=”TESTDATA1 TESTDATA2″

Now you would just type TESTIT whenever you wanted to execute the above command.

Another command that ties in rather loosely is the WHEREIS command. Here are some examples:

%WHEREIS EDITOR
----- EDITOR      MPE command
      EDITOR      Program file in PUB.SYS

%WHEREIS MPEX@

---- MPEX        System-level UDC in MPEXUDC.PUB.VESOFT
     MPEX        Program file in PUB.VESOFT

----- MPEXHELP    MPEX command

----- MPEXLDIR    Command file in PUB.SYS

----- MPEXMGR     Command file in WORK.VESOFT
      MPEXMGR     Command file in PUB.VESOFT

----- MPEXSTOR    MPEX command

This command takes the name of a command as its parameter and displays how MPEX would interpret the name if it were issued as a command. WHEREIS uses the same rules that MPEX uses at execution time to determine how a command is executed. The command identifies all instances of the command that exist, the first one shown is the one that would actually be executed.

The command parameter accepts wildcards, as shown in the second example.

The command is useful if MPEX appears to execute a different command from the one you intended. It shows you if you have conflicts between the names of your UDCs and command files, and also if your HPPATH gives you access to the commands that you expect it to.

MPEX uses the following precedence when determining which command to execute:

    1) MPEX aliases
    2) User-level UDCs
    3) Account-level UDCs
    4) System-level UDCs
    5) MPEX commands
    6) MPE commands
    7) temporary programs or command files in your HPPATH.
    8) permanent programs or command files in your HPPATH.

If the command parameter includes wildcard characters, all matching commands will be displayed. However, MPE commands are not shown when wildcard characters are used.

As you can see, an MPEX ALIAS will take precedence over any other command, which is why I covered it first. This also means that you can easily, and quickly, override an existing command by making an alias out of it.

That’s a wrap, see you next month.