For compatibility with legacy MultiValue systems, Caché labels each process with two separate identifiers: the process number, and the port number.
The process number is usually a 32-bit integer assigned by the operating system which cannot be changed by the user. Legacy MultiValue applications often expect a process identifier in a smaller range (for example, from 0 to the slightly above the number of licensed processes) and will have problems using a process id that varies over a 32-bit range. Additionally, MultiValue applications often expect a “nailed port number” where connections from a particular terminal or device always get the same identifier, or where the same program will operate differently based on what port or range of ports it runs on. So Caché provides both a process number which is fixed by the operating system, and a port number which can be set by the application.
The process number is the operating system process id. It can be retrieved using the ObjectScript $J system variable $JOB. In MVBasic, the @USERNO system variable (@USER.NO is a synonym for @USERNO) returns this value. The process number never changes during the lifetime of the process.
The port number is initially the position of the process’s entry in the system process table, but can be changed. The port number can be retrieved using the MVBasic system variable @PORTNO (or synonym @UDTNO). The port number is also the first part of the strings returned by the MV shell WHO command, and by the user exit U50BB.
The port number can be changed using the setPortNumber() method in the %SYSTEM.MVOpens in a new tab class. This changes the value of @PORTNO and the results from WHO and user exit U50BB.
The MV shell commands LISTU, JOBS, LIST-JOB, LISTME, and WHERE all display both the port and the process number.
Under this emulation, @USERNO returns the operating system process id, @UDTNO returns the process table number, and the U50BB user exit returns the same as @UDTNO. No changes should be necessary when porting programs from UniData to Caché. The UniData WHERE and WHO commands are fundamentally different from those in Caché, so some attention to detail is needed there.
In UniVerse, @USERNO returns the operating system process id, as do the WHO command and U50BB. There is no equivalent for @PORTNO in UniVerse. In Caché, @USERNO is the process id, but the WHO command returns the port number, so ported UniVerse applications may want to set the port number to match the process number at login.
In jBASE, @USERNO, @UDTNO and WHO all return the port number. When porting to Caché, references to @USERNO should be changed to @PORTNO.
D3 And Other PICK Versions
In D3, WHO, and U50BB return the port number as in Caché, but @USERNO returns the port number instead of the process number. When porting D3 programs to Caché, references to @USERNO should be changed to @PORTNO.