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

How to get UIC

Occasional Contributor

How to get UIC

I want to get the UIC of user account in numeric format from my VAX BASIC program. Which runtime library function should I use? Please help.
Steven Schweda
Honored Contributor

Re: How to get UIC

Hein van den Heuvel
Honored Contributor

Re: How to get UIC

For a general purpose identifier to ID service you would call SYS$ASCTOID.

For the UIC of the current process you would either call SYS$GETJPI with an item list requesting potentially many values or LIB$GETJPI for a simple single item. Both would be called a process ID = 0 and ITEM code JPI$_UIC. JPI$_UIC is defined in $JPIDEF (as 772).

See the basic user manual and GOOGLE for online examples.
Just google for: +openvms +basic + lib$getjpi

You'll find places like:

Good luck!
Robert Gezelter
Honored Contributor

Re: How to get UIC


I agree with Steven and Hein. However, it is more important to ask: Why does the program need the UIC?

There are very few instances in which the UIC is actually needed by a program. In most cases (e.g., file ownership) the best approach is to let OpenVMS propagate the information automatically.

What task is the program actually attempting to do?

- Bob Gezelter, http://www.rlgsc.com
Duncan Morris
Honored Contributor

Re: How to get UIC

I have attached a BASIC sample that has been in use for many years at a site which I support.

It accepts the username in various formats (see the comments in the source)

Honored Contributor

Re: How to get UIC

Terse questions beget terse answers. Often correct answers, but surprisingly often answers that are either less than the best available for the local requirements, or answers that are outright wrong for the particular situation.

Please consider providing some background details.

I can think of a half-dozen different ways to answer your stated question here, depending on exactly what you're up to here. Most of which will probably be wrong for what you intended.

As for the general answer for seeking code examples.

Aim your browser at http://www.itrc.hp.com

Select the Compaq Search Assistant ("James")

From there, you have access to 75,000 documents, of which many are full source code examples in a full selection of languages. And few of which are available via Google.

Thomas Ritter
Respected Contributor

Re: How to get UIC

Maybe some DCL will help ..

$ write sys$output f$identifer("system","Name_to_number")
$ write sys$output f$fao("!%U",f$identifer("system","Name_to_number"))