midrange.com code scratchpad
Name:
iSeries IP / hostname: how to get
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
01/20/2010 06:41:23 pm
IP:
Logged
Description:
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/apis/qtocrtvtcpa.htm

Use QtocRtvTCPA to get the host name of the system

Member type CLLE
Code:
  1. PGM                                                                                                 
  2. /*http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/apis/qtocrtvtcpa.htm*/
  3.  DCL        VAR(&hostname) TYPE(*CHAR) LEN(64)                                          
  4.  DCL        VAR(&domainname) TYPE(*CHAR) LEN(255)                                       
  5.  DCL        VAR(&RCVVAR) TYPE(*CHAR) LEN(512)                                           
  6.  DCL        VAR(&APIERR) TYPE(*CHAR) LEN(8) VALUE(X'0000000000000000')                                    
  7.  DCL        VAR(&TCPAFORMAT) TYPE(*CHAR) LEN(8)   VALUE('TCPA0300')                                      
  8.  DCL        VAR(&RCVVARLEN) TYPE(*CHAR) LEN(4)                                          
  9.  DCL        VAR(&MSGID) TYPE(*CHAR) LEN(7)                                              
  10.  DCL        VAR(&MSGDTA) TYPE(*CHAR) LEN(256)                                           
  11.  DCL        VAR(&MSGF) TYPE(*CHAR) LEN(10)                                              
  12.  DCL        VAR(&MSGFLIB) TYPE(*CHAR) LEN(10)                                           
  13.  DCL        VAR(&MSGTXT) TYPE(*CHAR) LEN(256)                                           
  14.  
  15.       chgvar %Bin(&RcvVarLen) 512                                                            
  16.       callprc 'QtocRtvTCPA' ( &RcvVar    +                                                                 
  17.                               &RcvVarLen +                                                    
  18.                               &TCPAFormat    +                                                
  19.                               &ApiErr)                                                        
  20.                                                                                                     
  21.       ChgVar  &hostname      %SST(&RcvVar 177 64)                                            
  22.       ChgVar  &domainname    %SST(&RcvVar 241 255)                                           
  23.                                                                                                     
  24.       SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&hostname) +                          
  25.                          MSGTYPE(*info  )                                                           
  26.       SNDPGMMSG  MSGID(CPF9897) MSGF(QCPFMSG) MSGDTA(&domainname) +                        
  27.                          MSGTYPE(*info  )                                                           
  28. engpgm
© 2004-2019 by midrange.com generated in 0.006s valid xhtml & css