forcing a cc=4 after sftp_put.sh error

A discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
MikeL
Posts: 1
Joined: Tue Oct 03, 2017 12:21 pm

forcing a cc=4 after sftp_put.sh error

Post by MikeL » Tue Oct 03, 2017 12:52 pm

How do I force a cc=4 if the sftp_put.sh script does not successfully move the file from mainframe to server.
Here is a sample of what I'm feeding COZBATCH thru DD SFTPIN:
user=admin
pwdsn="lev.parm(pswd)"
host=hostcomputer
lzopts="mode=text,linerule=crlf,notrim"
lfile=//DD:DD2SFTP
rfile=&FILE..&GDGVER.
. $script_dir/sftp_put.sh
user=admin
pwdsn="lev.parm(pswd)"
host=hostcomputer
lzopts="mode=text,linerule=crlf,notrim"
lfile=//DD:FTPDONE
rfile=&FILE..&GDGVER..FTPDONE
. $script_dir/sftp_put.sh

thanks

Mike

dovetail
Site Admin
Posts: 1839
Joined: Thu Jul 29, 2004 12:12 pm

Re: forcing a cc=4 after sftp_put.sh error

Post by dovetail » Wed Jan 17, 2018 10:31 am

You can you own shell commands/script to the end, like:

rc=$?
test $rc -ne 0 && exit 4
exit 0

Post Reply