|
Here ya go. Another good one I will add to my source page. This one will
work on at least V3R2 and up. You can MONMSG on PING in newer releases, but
this will work on all of them.
PGM PARM(&IP &OK)
DCL VAR(&IP) TYPE(*CHAR) LEN(30)
DCL VAR(&OK) TYPE(*CHAR) LEN(1)
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&MSGDATA) TYPE(*CHAR) LEN(4)
CHGVAR VAR(&OK) VALUE('Y')
PING RMTSYS(&IP) MSGMODE(*QUIET) NBRPKT(1)
MONMSG MSGID(TCP0000) EXEC(DO)
CHGVAR VAR(&OK) VALUE('N')
GOTO CMDLBL(END)
ENDDO
RCVMSG MSGQ(*PGMQ) MSGTYPE(*LAST) MSGDTA(&MSGDATA) +
MSGID(&MSGID)
IF COND(%BIN(&MSGDATA) *EQ 0) THEN(DO)
CHGVAR VAR(&OK) VALUE('N')
ENDDO
END: ENDPGM
Bradley V. Stone
BVS/Tools
http://www.bvstools.com
> -----Original Message-----
> From: Gary Kuznitz [mailto:docfxit@calwest.net]
> Sent: Thursday, October 07, 1999 1:14 PM
> To: MIDRANGE-L@midrange.com
> Subject: Ping to test a connection to see if it's alive?
>
>
> Hi,
>
> I was wondering if anyone would be willing to share a CL pgm
> that does a
> ping to test a connection to see if it's alive?
>
> I sure would appreciate it.
>
> Thank you,
>
> Gary Kuznitz
> +---
> | This is the Midrange System Mailing List!
> | To submit a new message, send your mail to MIDRANGE-L@midrange.com.
> | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
> | To unsubscribe from this list send email to
> MIDRANGE-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
> david@midrange.com
> +---
>
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
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.