|
This is the skeleton of what we do before any FTP:
DCL VAR(&SUCCESSBIN) TYPE(*CHAR) LEN(4)
DCL VAR(&SUCCESSDEC) TYPE(*DEC) LEN(15)
PING RMTSYS(&RMTSYS) INTNETADR(&IP) NBRPKT(10) /* +
Check if the remote system responds */
MONMSG MSGID(TCP3202) EXEC(DO) /* Unknown Host */
(send some error message)
GOTO (some label)
ENDDO
RCVMSG MSGTYPE(*COMP) RMV(*NO) MSGDTA(&MSGDTA12) +
MSGID(&MSGID) /* Get the last completion +
message; it should be TCP3210 which gives +
the success percentage */
IF COND(&MSGID *NE 'TCP3210') THEN(DO) /* If +
not what we expected */
GOTO CMDLBL(STRFTP) /* Try the FTP anyways */
ENDDO
CHGVAR VAR(&SUCCESSBIN) VALUE(%SST(&MSGDTA12 9 4)) +
/* Extract out the success percentage */
CVTBIN4DEC BINARY(&SUCCESSBIN) DECIMAL(&SUCCESSDEC) /* +
and convert to decimal so we can check it +
easiliy */
IF COND(&SUCCESSDEC *GE 10) THEN(DO) /* If at +
least 10% of the pings worked */
GOTO CMDLBL(STRFTP) /* Do the FTP */
ENDDO
ELSE CMD(DO)
(send some error message)
ENDDO
Scott Lindstrom
Zenith Electronics
+---
| 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.