× 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.



Todd .... I made just a few modifications ... User Space name / library and
changing the &INLSIZE variable from *CHAR to *DEC ... It seems to work when
IP is active... I'll have to test it later when IP is down though.

Thanx for your help! This is exactly what I was looking for.

Kenneth

-----Original Message-----
From: Todd kidwell [mailto:Todd.kidwell@3cc.co.wayne.mi.us]
Sent: Tuesday, November 26, 2002 3:52 AM
To: midrange-l@midrange.com
Subject: Re: Check to see if TCP/IP is up


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

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


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.