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

Reference count exceeded

SOLVED
Go to solution
JHKCMO
Occasional Advisor

Reference count exceeded

OpenVMS 7.3-2
I get this error when I run a command from login.com to change my environment logicals:

Fatal Error -- Reference count for the terminal is 22
reduce the number of processes attached to the terminal
** Returned to previous environment **


However, when I run this command interactively, it works:

$ envset test



** Jumping to environment test **


This happens to two others logging on to this node, all of us using the same user account (a process account we are testing). The only Reference Count I can find is in the terminal device I am logging on with (sho dev NTY130/full), but this count is 2. Where is the "22" stored and is there anyway to clear it? I have verified that there are no processes or users running under this userID, so logging out does not clear this.

Thanks!



11 REPLIES
Steven Schweda
Honored Contributor

Re: Reference count exceeded

What are "environment logicals"? And whence
came "envset"? That complaint appears to
come from your program, not from VMS.
Jan van den Ende
Honored Contributor

Re: Reference count exceeded

JHKCMO,

To begin with,

WELCOME to the VMS forum.

Your problem.

Firstly, I _REALLY_ must advise against multiple users using the same account!
In cases like this, ANY treaces of what has happened loose any traceability.

Now, "envset" is NOT a VMS command. I might try to guess what it can do, but I would rather have precise information.
Try
$ show symbol envset
and chances are it will show some more (although it MIGHT by defined as a DCLTABLES addition...)

If iyt is a symbol, and it equates to
"@
pleas locate the , and a copt REMEMED TO .TXT!!!!

Please scan for any @-ed procedures, and if there are not too many, attach those in secundary replies, or, better, make one .TXT file with all of them (clearly indication separate files)

Lets's see what we can get out, eh?

Proost.

Have one on me.

jpe

Don't rust yours pelled jacker to fine doll missed aches.
JHKCMO
Occasional Advisor

Re: Reference count exceeded

envset is an executable (not HP's) that sets logicals from which a user can run software, so 'envset prod' allows a user to run programs from the prod directory and write to the prod database instance, while 'envset test' allows running from and writing to that code environment.

Hope that makes sense. There will never be muiltiple users using this account, just a process on a remote system. For me, the question is why it works interactively, but not from login.com.
Steven Schweda
Honored Contributor

Re: Reference count exceeded

> [...] the question is why it works
> interactively, but not from login.com.

Probably depends on exactly what it does,
which remains a mystery.

Ask the fellow who wrote/supplied it?
David Jones_21
Trusted Contributor
Solution

Re: Reference count exceeded

Sounds like it is using $GETDVI to get the reference count on SYS$INPUT and calling that the 'terminal' reference count. In a command procedure, the $GETDVI call will return the current reference count for disk the file resides on since SYS$INPUT is being redirected to the procedure. Try adding a "$ DEASSIGN SYS$INPUT" command prior to the envset command.

The program in question should really be testing SYS$COMMAND, not SYS$INPUT.
I'm looking for marbles all day long.
JHKCMO
Occasional Advisor

Re: Reference count exceeded

Awesome! Thanks David! I'm left with one remaining problem if someone can help me further. My envset works, but the last command in my login.com does not run after that. I just need to set def to the correct directory.
login.com....
.....
$ ENVSET TEST
$ SET DEF USER01:[DEV1]
$ EXIT

After envset runs, I am in a bogus directory:
$ sho def
$1$DGA1:[DEV1]
%DCL-I-INVDEF, $1$DGA1:[DEV1] does not exist

How can I run that set def command non-interactively after my envset command?

Thanks All!
Steven Schweda
Honored Contributor

Re: Reference count exceeded

> How can I run that set def command
> non-interactively after my envset command?

Probably depends on exactly what it does,
which remains a mystery.

For example, if it creates a new sub-process
for you, then subsequent commands in the
command procedure can't do much until it's
too late.

Why can't you SET DEFAULT _before_ you run
the mystery command?
JHKCMO
Occasional Advisor

Re: Reference count exceeded

I tried that but the envset includes, I believe, a set def command; I'm not sure where it picks this up, but when I set def beforehand, my process is still redirected by envset.
Steven Schweda
Honored Contributor

Re: Reference count exceeded

> I tried that but [...]

I can believe that. It appears that you have
an application problem, not a VMS problem,
and, as we don't even know what that
application is (although Google offers some
possible clues), we don't know what it does,
so the best you can hope for here is an
insightful guess or two. Unless the
application vendor's support is particularly
poor, it's not clear to me why you're asking
about it here rather than there.

For all I know, there's some mystery
configuration file where you can specify a
default directory to be used for environment
"test". I could try reading the manual, if I
had any idea which product we're discussing.
David Jones_21
Trusted Contributor

Re: Reference count exceeded

I'd guess one of the logicals envset is defining is USER01 (as $1$DGA1), which is ostensibly valid at some other installtion. Use the search command to look within the evnset.exe file for the string $1$DGA1 - it may be hardcoded into the program. Otherwise it may be in a configuration file read by envset.
I'm looking for marbles all day long.
DSM_1
Advisor

Re: Reference count exceeded

envset.exe is a proprietary program from Cerner Corporation for its Millennium healthcare system. It is not documented (that I can find) on their web site. I believe it was created for internal Cerner use, but many Cerner customers use it. There is one version for VMS and a different, but equivalent, version for Unix systems.

I have never used it, as I wrote a DCL script to do something similar, which satisfies my needs. I did play with envset once, a long time ago, and deduced a couple of things about it. And I still have an e-mail from its author, dated 2001, describing its use.

If JHKCMO poses his questions to one of the Cerner list servers, they will be seen by others with experience of this program. (But I have found a couple of the responses in this, HP, forum quite interesting.)

In answer to some other questions:

What are "environment logicals"? These are a set of logical names defined in a group logical name table that defines things like standard directories, the executables used, and the database one connects to.

What does EnvSet do? I am not sure of all the details. It seems to spawn a detached process with the same user portion of the UIC, but a different group number. Control is transferred to the detached process. Perhaps the detached process runs its own login.com on startup? A Show User command does not list it as a sub-process. Logging out returns control to the previous process.