Operating System - OpenVMS
1828248 Members
2838 Online
109975 Solutions
New Discussion

Re: Error activating image

 
ram_47
Frequent Advisor

Error activating image

Could anyone give an example on how to use DEFINE command?

after i use DEFINE and try to run my program i see 'error activating image' and 'directory not found' error. could anyone pl help.
22 REPLIES 22
Uwe Zessin
Honored Contributor

Re: Error activating image

A small session log would help us to tell you what went wrong.

My guess is that you did define a logical name that maps to an image name. E.g.

$ define directory xyz
$ dir
%DCL-W-ACTIMAGE, error activating image DIRECTORY
-CLI-E-IMAGEFNF, image file not found DSA0:[SYS0.SYSCOMMON.][SYSEXE]XYZ.EXE;
$ deassign directory
$
.
ram_47
Frequent Advisor

Re: Error activating image

RE5::[VMSUSER] >define /nolog CLD$EXE disk51:[USER.VMSUSER]
RE5::[VMSUSER] >set command testcli.cld
RE5::[VMSUSER] >testcli /input=in.txt /output=out.txt
%DCL-W-ACTIMAGE, error activating image CLD$EXE:TESTCLI.EXE
-CLI-E-IMGNAME, image file DSA51:[USER.VMSUSER]TESTCLI.EXE;
-RMS-E-DNF, directory not found
-SYSTEM-W-NOSUCHFILE, no such file
RE5::[VMSUSER] >
Jan van den Ende
Honored Contributor

Re: Error activating image

Ram,

Uwe gave one potential reason.
Without further info, he may be right.
Another possibility is, that you defined a logical name pointing to a non-existing directory (maybe typo?) and then used thet LNM in your RUN command.

General remark:
Please ALWAYS include a QUOTE of the LITTERAL, COMPLETE error message. That usually contains a good explanation of the problem!

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Uwe Zessin
Honored Contributor

Re: Error activating image

Yes, that's better.

It looks like "CLD$EXE" is not defined correctly. There is another logical name involved: "DISK51", but as it points to a disk named "DSA51:" it might be as simple as CLD$EXE pointing to the wrong disk.
.
Willem Grooters
Honored Contributor

Re: Error activating image

As usual, see $ HELP and teh DCL reference manual....

A short view:

$ DEFINE

: just any name you wish, however be sure not to use a name you want to keep or need elsewhere.
: a specification of what will be represented by that logical. In most cases, you will want to name some storage location, so this will be in the form of :[]. In principle, can itself be a logical as well. The directory part ([]) can be ommitted, it is actually an "alias".

To define a root-directory, under which there are more directories. you need to use the /TRANSLATION=CONCEALED attribute. If the specification contains a real device, or is nothing more than that, you can also mention "TERMINAL". This type of specification always ends "with a dot: there is more to come.

Examples:

$ DEFINE USER DKA0:[USER.]/TRANSLATION=(CONCEALED, TERMINAL)

Mind: user . Required now is CONCEALED, and since DKA0: specifies the disk, TERMINAL is valid here.

Now you can specify:

$ DEFINE HOME USER:[OTWILLEM]

If this is translated, it will be expanden to the full spec DKA0:[USER.OTWILLEM]

$ DEFINE HOME SYS$LOGIN:

nakes HOME the same directory as wehere SYS$LOGIN refers to.

If you would specify:

$ DEFINE EXEDISK MYDISK:[PROGRAMS.]/TRANS=(CONCEALED, TERMINAL)
$ DEFINE EXE EXEDISK:[EXE]

you will get the "Directory not found" error, when MYDISK does not refer to a physical disk. In that case, just remove the TERMINAL attribute and it will work.

Keep in mind that there are different levels of definition; PROCESS, JOB, GROUP, SYSTEM and , if applicable, CLUSTER. They specify the scope of the logical in that order (normally). This means you can "overwrite", in your private conext, any other in a "deepër" level: If, for instance, a logical EXEDISK is defined /SYSTEM, you can give it a complete other contents when specifying /PROCESS (which is, BTW, default), without interfering with other users.

Willem Grooters
OpenVMS Developer & System Manager
ram_47
Frequent Advisor

Re: Error activating image

Where do I need to define "CLD$EXE".
Uwe Zessin
Honored Contributor

Re: Error activating image

ram,
the problem is with the contents of the logical name, not how it is defined.

What output do you get from the following commands?

$ show default

$ directory DSA51:[000000]USER.DIR;1

$ directory DSA51:[USER]VMSUSER.DIR
.
ram_47
Frequent Advisor

Re: Error activating image

UWe -

Here is the output

RE5::[VMSUSER] >show default
DISK51:[VMSUSER.SOURCE.CLD]

RE5::[VMSUSER] >directory DSA51:[000000]USER.DIR;1
%DIRECT-W-NOFILES, no files found

RE5::[VMSUSER] >directory DSA51:[USER]VMSUSER.DIR
%DIRECT-E-OPENIN, error opening DSA51:[USER]VMSUSER.DIR;* as input
-RMS-E-DNF, directory not found
-SYSTEM-W-NOSUCHFILE, no such file

RE5::[VMSUSER] >
Uwe Zessin
Honored Contributor

Re: Error activating image

Now, compare the output with your logical name definition:

> define /nolog CLD$EXE disk51:[USER.VMSUSER]

You see that there is no USER directory between VMSUSER and the master file directory.

I don't know where the executable is stored, try:

$ define /nolog CLD$EXE disk51:[VMSUSER]
$ ...

If that does not work, look where the executable is:

$ directory DISK51:[VMSUSER...]TESTCLI.EXE

and use this directory.
.
ram_47
Frequent Advisor

Re: Error activating image

The EXE is at DISK51:[VMSUSER.SOURCE.CLD]. also, am running the DEFINE command from the same directory.
Uwe Zessin
Honored Contributor

Re: Error activating image

Then use:
$ define /nolog CLD$EXE DISK51:[VMSUSER.SOURCE.CLD]

The logical name specifies a full path. In that case it doesn't matter what your current context is.
.
Willem Grooters
Honored Contributor

Re: Error activating image

$ DEFINE CLD$EXE DISK51:[VMSUSER.SOURCE.CLD]

should be right. No matter where you define it.

Also check the .CLD file for the location on your image. This should be CLD$EXE: as well.
Willem Grooters
OpenVMS Developer & System Manager
ram_47
Frequent Advisor

Re: Error activating image

I issued 'define /nolog CLD$EXE DISK51:[VMSUSER.SOURCE.CLD]' from [VMSUSER] directory and then tried to run my program TESTCLI.EXE and it worked.

Earlier I issued the DEFINE command from [VMSUSER.SOURCE.CLD] directory, where my program is located. I used to get errros when i ran my program. Does it matter from where I give the DEFINE command?
Uwe Zessin
Honored Contributor

Re: Error activating image

In this particular case, no. All data is fully specified.
.
Antoniov.
Honored Contributor

Re: Error activating image

Define creates a new logical name. You can imagine it like a new mapped disk. Everytime you refer to a logical name you refer a full path to its translation.
If translation is not valid, every command fails as you discovered.
HELP DEFINE is your friend.

Antonio Vigliotti

Antonio Maria Vigliotti
Uwe Zessin
Honored Contributor

Re: Error activating image

Here is an example of context-dependent logical name assignments:

$ define A1 DSK:'F$DIRECTORY()'
$ show logical A1
$ set default [.X1]
$ define A1 DSK:'F$DIRECTORY()'
$ show logical A1
.
ram_47
Frequent Advisor

Re: Error activating image

Since the DEFINE command does not have a fully qualified path it becomes context dependent, is my understanding right?
Willem Grooters
Honored Contributor

Re: Error activating image

Like this:

$ SET DEFAULT DISK51:[000000]
$ DEFINE CLD$EXE [VMSUSER.SOURCE.CLD]
$ RUN CLD$EXE:

RUN may fail.

If this
$ SET DEFAULT
$ DEFINE CLD$EXE DISK51:[VMSUSER.SOURCE.CLD]
$ RUN CLD$EXE:

should work.

You don't need a .CLD here, unless you have compiled it to an object and linked it with your program.

$ SET COMMAND <.CLD-file>

might be needed. Be sure that if the program is specified in there, use CLD$EXE as well.

Does your program access some other file? It might be the program does start but signales the error when it tries to access a file on a non-existing directory.
Specify:

$ RUN/DEBUG CLD$EXE:.
If this will return to the debugger prompt, the program DOES start.

Willem Grooters
OpenVMS Developer & System Manager
Uwe Zessin
Honored Contributor

Re: Error activating image

No, in my example the 'trick' is to use a lexical function that returns the current directory. It still creates a logical name with a full path depending on the current context, so after the command has been executed it does not matter if you change your default context:

$ set default DISK51:[VMSUSER.SOURCE.CLD]
$ show default
$ define A1 DISK51:'F$DIRECTORY()'
$ show logical A1
$ directory A1:

$ set default [--]
$ show default
$ show logical A1
$ directory A1:

You see? A1 has not changed.
.
Antoniov.
Honored Contributor

Re: Error activating image


Since the DEFINE command does not have a fully qualified path it becomes context dependent, is my understanding right?

may be true, may be false ...

VMS filesystem has:
device, directory, file with extension.
Device is disk, e.g. DKA0: may be a logical name like SYS$SYSDEVICE:
directory is tree path; in vms directories are written enclosed by square brackets [ ]; e.g. [SYS0.SYSCOMMON] is directory SYSCOMMON under directroy SYS0.
Anye level of file system (device, directory or file) may be redefined by a logical name.
You can type
$ SHO LOG SYS$SYSDEVICE /FULL
to see a system definition of system disk.
$ SHOW LOG SYS$STARTUP /FULL
to see a system definition of directory
$ SHOW LOG SYS$SYLOGIN
to see a system definition of a file.

Every time you refer to a file and you omit some part of it, os take missed part by SET DEF command.
You can understand this concept using F$PARSE funcion.
Type
$ WRITE SYS$OUTPUT F$PARSE("MYFILE")

Sorry for long sentence, but I hope this can help you.

Antonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: Error activating image

Ram,
to check your first post:
$ define /nolog CLD$EXE disk51:[USER.VMSUSER]
$ write sys$output f$parse("testcli.cld")

Antonio Vigliotti
Antonio Maria Vigliotti
Dale A. Marcy
Trusted Contributor

Re: Error activating image

Antonio stated: "Every time you refer to a file and you omit some part of it, os take missed part by SET DEF command."

There is one instance where this is not the case, and that is when specifying a log file on a submit command. In that case at least the disk portion (can't remember about the directory) is taken from the translation of Sys$Login. I recently was trying to track down a problem where a user's submit command stopped working after moving to a new system. It was because they were using [.sub_dir] for the /Log=. On the old system, their login directory was on the same disk as the [.sub_dir], so it worked. On the new system their login directory was on a different disk than the [.sub_dir] and it did not work.