vikas
vikas

Reputation: 145

What is the equivalent command of Unix's which in VMS

I have a tool xyz in VMS. I want to get the location where it is installed. For example, in unix we can achieve this by using which command. So, please help me with the VMS equivalent of this command.

Upvotes: 4

Views: 1120

Answers (4)

vmsdriveby
vmsdriveby

Reputation: 1

A hands-on way to locate the EXE-image. That's what I would do:

  1. Ask your colleague or VMS admin

  2. Check a foreign command, e.g. MYEXE (MYEXE :== $SOMEWHERE:[DIR]MYEXE.EXE):

    SHOW SYMBOL/GLOBAL MYEXE
    DIR 'f$string(MYEXE - "$")
    
  3. Check a foreign batch command, e.g. MYCOM (MYCOM :== @SOMEWHERE:[DIR]MYCOM.COM):

    DIR 'f$string(MYCOM - "@")
    
  4. Check a defined DCL command verb, e.g. MYVERB (SET COM MYCOMMANDS.CLD) -- this one is the trickiest, depending on how .CLD file was processed), you may need a VERB utility (VMS freeware) to extract the details of the command verb from DCLTABLES.EXE

    HELP MYVERB
    HELP VERB
    DIR SYS$SYSTEM:MYVERB.EXE
    

However, if you got to this point in your search, I would actually look through the LOGIN procedures, that's where such verb would potentially be set from a .CLD file ... unless the custom DCLTABLES where directly installed. So it is tricky and should be directed to the admin.

   SEARCH SYS$LOGIN:LOGIN.COM MYVERB, "SET COM", ".CLD"
   SEARCH SYS$MANAGER:SY*.COM MYVERB, "SET COM", ".CLD"

Still, the easiest is to ASK your colleague or your friendly VMS-admin... unless your are both of them :)

Upvotes: 0

Suresh Dooly
Suresh Dooly

Reputation: 57

You can use....

$ PRODUCT SHOW HISTORY

the above command will help you to show installed products.

Upvotes: 0

g1l1t1
g1l1t1

Reputation: 31

Since user2116290 has mentioned the freeware VERB utility I'll put in a plug for another freeware utility called DFU (for Disk/File Utilities).

One thing DFU can do is to search a disk volume's index file for all files matching a particular name. (It can also search by date, file size, file owner, and more).

DFU can do a lot of other useful things. Have a look at the website I linked to above for more information.

Upvotes: 0

user2116290
user2116290

Reputation: 1072

There is no equivalent command of which in VMS. To find the location of such a tool it depends on how the tool is set up on VMS. VMS commands can be DCL commands, aka DCL verbs, or foreign commands, aka DCL symbols. I assume you invoke the xyz tool with just typing "xyz" at the DCL command prompt.

DCL verbs are defined in a DCL command table. Your system administrator may have added the xyz tool to one of the DCL command tables, for example with the $ SET COMMAND command in the system wide LOGIN command procedure. If your tool is set up as a DCL command, you may want to get and look at the VERB utility (this utility is available from the VMS freeware CD), which will show you your XYZ command, with a DCl command $ VERB XYZ. Its output will list an "image" line, so anything after that keyword is the (file) specification of the tool's executable image. The default directory here is SYS$SYSTEM, which is a logical name. Keep in mind that the specification can be a (full) VMS file specification or just a logical name.

For foreign commands - almost always used for tools ported from Unix - you can check for the DCL symbol with the DCL command $ SHOW SYMBOL XYZ. If the tool is setup up this way, you will see an output like "XYZ == $file_ specification". Again, the file specification can be a (full) VMS file specification or just a logical name.

Additionally, recent versions of VMS support automatic foreign commands. That is, executable images (and command procedures), which are found in the directoy/-ies pointed to by the logical name DCL$PATH, will automatically be used as a foreign command. So your tool xyz may be a file in such a directory. This would be the easiest way to find its location: $ DIRECTORY DCL$PATH:XYZ should do it.

Upvotes: 6

Related Questions