Kbase 18836: How to Find the Hostname Within a Program
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/14/1999 |
|
SUMMARY:
Sometimes it is desirable to know, from within a Progress application, the name of the UNIX system you are using. As of this writing
(May 1999), there is no command within Progress that will return this value. However, this can be determined programmatically, using the 4GL and UNIX utilities.
SOLUTION:
Using the UNIX command line, run uname to determine the name of the
host. uname is a UNIX utility that gives basic information about
the system. On Solaris, this would be 'uname -n'. Please refer
to your UNIX system man pages (or manuals) for the appropriate
syntax.
Now we use Progress 4GL code to read this value into a variable.
The following code is an example (for Solaris):
DEFINE VARIABLE v_sysname AS CHAR NO-UNDO.
INPUT THROUGH "uname -n" NO-ECHO.
SET v_sysname.
INPUT CLOSE.
DISPLAY v_sysname.
References To Written Documentation:
UNIX System man pages, or documentation on uname command
Progress Programming Handbook