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



QSH CMD(&QSHCM)

RTVJOBA JOB(&JOBNAME) USER(&JOBUSER) NBR(&JOBNUM)

RCVMSG MSGTYPE(*COMP) RMV(*NO) MSGDTA(&MSGDTA) MSGID(&MSGID)

CRTPF FILE(QTEMP/SFTPLOG) RCDLEN(136)
MONMSG MSGID(CPF0000)

CPYSPLF FILE(QPRINT) TOFILE(QTEMP/SFTPLOG) +
JOB(&JOBNUM/&JOBUSER/&JOBNAME) +
SPLNBR(*LAST) MBROPT(*REPLACE) +
CTLCHAR(*PRTCTL)

IF (&MSGID *EQ 'QSH0005') THEN(DO)
CHGVAR &RC %BIN(&MSGDTA)

CALL PGM(SFTPLOG) PARM(&OK)

ENDDO

DMPCLPGM /* DUMP WILL SHOW RC AS 0 (SUCCESS) OR 1 (FAIL) */

ENDPGM

**************************************************************************
H/TITLE SFTPLOG - Check SFTP log for success/failure
H DATEDIT(*YMD)
H* Program Name : SFTPLOG - Check SFTP log for success/failure
**************************************************************************
Fsftplog ipe f 136 disk
**************************************************************************

dsearchfor s 10
dpos s 4s 0
**************************************************************************
* Input Parameters
isftplog AA 01

* Record type

i 1 136 irec
**************************************************************************
C *ENTRY PLIST
C PARM OK 1

c eval searchfor = 'Uploading'
c exsr search

c if pos <> 0
c eval ok = 'Y'
c endif

c eval searchfor = 'Fetching '
c exsr search

c if pos <> 0
c eval ok = 'Y'
c endif
**************************************************************************
C search begsr
**************************************************************************

/free

pos = %scan(searchfor: irec :1);

/end-free

c endsr


Paul

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Jerry Draper
Sent: Monday, July 09, 2018 6:07 PM
To: Midrange Systems Technical Discussion
Subject: monitoring batch shell scripts

Let's say you have a CL pgm that does a CALL QP2BATCH(xx.sh <parms>)
where control goes over to the *ix side of the world.

Let's say that the xx.sh script runs and sFTP, python, or perl script.

What happens if one of these err out. How would the CL calling process
know?

We had one case where an sFTP script was erring out because the server
was displaying a connection msg. Once we piped std err to a file all
completed normally.

Thanks,


Jerry



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.