How can I find out my System IP Address through CL/RPG?

95 pts.
Tags:
AS/400 administration
AS/400 IP address
CL/400
RPG/400
I would like to know my system IP-Adress , to validation with User name and IP-Address.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

With ILE, you can use API gethostid().

The link to the manual is :

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/ghosti.htm

Regards,

Wilson

Hi i worte a liitle CL for this Issue

Which is

DCL &RCVVAR *CHAR ( 892 )
DCL &RCVVARLEN *CHAR ( 4 ) ( X’0000037C’ )
DCL &FORMAT *CHAR ( 8 ) ( ‘DEVD0600′ )
DCL &DEVD *CHAR ( 10 )
DCL &APIERROR *CHAR ( 8 ) ( X’0000000000000000′ )

DCL &IPADDR *CHAR ( 15 )
DCL &MSGID *CHAR ( 7 )
DCL &MSGDTA *CHAR ( 256 )

DCL &MSGF *CHAR ( 10 )
DCL &MSGFLIB *CHAR ( 10 )
DCL VAR(&MSG) TYPE(*CHAR) LEN(50)
DCL VAR(&INF) TYPE(*CHAR) LEN(50)

MONMSG ( CPF0000 MCH0000 ) EXEC( GOTO ERROR )

RTVJOBA JOB( &DEVD )
CALL PGM(QDCRDEVD) PARM(&RCVVAR &RCVVARLEN +
&FORMAT &DEVD &APIERROR)
CHGVAR &IPADDR ( %SST( &RCVVAR 878 15 ) )
CHGVAR VAR(&MSG) VALUE(&DEVD *BCAT ‘IS BEING USED +
BY’ *BCAT &IPADDR)

SNDBRKMSG MSG(&MSG ) TOMSGQ(&DEVD)

ERROR:

RCVMSG MSGTYPE( *EXCP ) +
RMV(*NO ) +
MSGDTA( &MSGDTA ) +
MSGID( &MSGID ) +
MSGF( &MSGF ) +
MSGFLIB( &MSGFLIB )
MONMSG ( CPF0000 MCH0000 )

SNDPGMMSG MSGID( &MSGID ) +
MSGF( &MSGFLIB/&MSGF ) +
MSGDTA( &MSGDTA ) +
MSGTYPE( *ESCAPE )
MONMSG ( CPF0000 MCH0000 )

ENDPGM

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following