× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Rob:

If you're on your own system and you have a single IP address and you maintain 
the hostname in some standard way, you can probably get this easily from the 
QUSRSYS/QATOCHOST file with a little experimentation. But systems are often not 
so simple.

One way I've done this is with a sequence like the following in RPG:

Get the configured host name...

Eval      RC = GetHostName( %addr( TstName ) 
                          : 256              
                          )                  
Get the configured host name host entry structure...

Eval      Host@ = GetHostByName( %Addr( TstName  ))

Convert the 32-bit address to dotted decimal form...

Eval      IPAddr@ = InetNtoA( HAddrArr(1)
                            )            

GetHostName() returns the host name. I feed that into GetHostByName() in order 
to return the host entry data structure which includes the 32-bit network 
address. Then I convert the network address to dotted-decimal.

It seems to work reasonably well and could be turned into a command-processing 
program or CALLed from CL.

I'm not aware of a better way in the long run.

Tom Liotta

midrange-l-request@midrange.com wrote:

>   7. Gettting the IP address (Rob Phillips)
>
>HI Is there a command or way to get the IP address of a machine? Can this be 
>done in a CL also?

-- 
Tom Liotta
The PowerTech Group, Inc.
19426 68th Avenue South
Kent, WA 98032
Phone  253-872-7788 x313
Fax    253-872-7904
http://www.powertechgroup.com


__________________________________________________________________
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at 
http://webmail.netscape.com/

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.