|
Ken,
Here is a quick CL program to check the status of TCP/IP. I use this in a
routine that checks to make sure all Host Services are active as well. I have
left out all error checking and object validations. This is the stripped down
version, but it may point you in the right direction.
Pgm
Dcl Var(&InlSize) +
Type(*Char) +
Len(6 0) +
Value(1000)
Dcl Var(&Size) +
Type(*Char) +
Len(4)
Dcl Var(&Start) +
Type(*Dec) +
Len(6 0) +
Value(133)
Dcl Var(&Len) +
Type(*Dec) +
Len(4 0) +
Value(4)
Dcl Var(&StrPos) +
Type(*Char) +
Len(4)
Dcl Var(&DataLen) +
Type(*Char) +
Len(4)
Dcl Var(&Receiver) +
Type(*Char) +
Len(1000)
Dcl Var(&Entries) +
Type(*Dec) +
Len(8 0) +
ChgVar Var(%bin(&Size)) +
Value(&InlSize )
ChgVar Var(%bin(&StrPos)) +
Value(&Start)
ChgVar Var(%bin(&DataLen)) +
Value(&Len)
Call Pgm(QUSCrtUS) +
Parm('QTEMP TCPSTSCHK ' +
'PROD' +
&Size +
' ' +
'*EXCLUDE' +
'TCP/IP Status Check')
Call Pgm(QUSLJob)
Parm('QTEMP TCPSTSCHK ' +
'JOBL0100' +
'QTCPIP *ALL *ALL ' +
'*ACTIVE')
Call Pgm(QUSRtvUS) +
Parm('QTEMP TCPSTSCHK ' +
&StrPos
&DataLen
&Receiver )
ChgVar Var(&Entries) +
Value(%bin(&Receiver 1 4))
If Cond(&Entries *gt 0) +
Then(Do)
TCP/IP is active .... continue.
EndDo
Else Cmd(Do)
TCP/IP is not active ... loop and recheck.
EndDo
EndPgm:
EndPgm
Let me know if you have any questions.
Thanks
Todd Kidwell (Netstar)
AS/400 System Administrator
(313) 224-0578
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.