SFTP thru COZBATCH

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
vijuvivi
Posts: 1
Joined: Tue Aug 23, 2022 12:32 pm

SFTP thru COZBATCH

Post by vijuvivi »

Hi Team

We are trying to setup SFTP through COZBATCH, the job was completed successfully but the respective file was not transferred to the destination.
We couldn't get any error information in the joblog for further analysis.

Could you please help me for the resolution or how to capture the error log.

Below is the control card we passed in the SFTP job.

Control Card :

# Customize these ...
coz_bin="/usr/local/coz/bin"
remoteuser="ft1656m0"
server="qa.sftp.b2bmft.metlife.com"
# These can be used to read the ssh password from a (secured) dataset
# if you don't want to setup public/private keypairs
export PASSWD_DSN='//F5491TGH.SIBI.IN4848(F5491FC5)'
export SSH_ASKPASS=$coz_bin/read_passwd_dsn.sh
export DISPLAY=NONE
ssh_opts="$ssh_opts -oBatchMode=no"
ssh_opts="$ssh_opts -oConnectTimeOUT=20"
ssh_opts="$ssh_opts -oServerAliveInterval=20"
ssh_opts="$ssh_opts -oStrictHostKeyChecking=no"
ssh_opts="$ssh_ pts -oPort=20901"
$coz_bin/cozsftp $ssh_opts -b- $remoteuser@$server <<EOB
lzopts mode=text,linerule=crlf,
ls
CD /outbound
ls
put //DD:DOWNLD1 sibifcaquat.csv
ls
EOB


JOBLOG :

CoZBatchÝN¨: version: 5.1.1 2018-06-01
CoZBatchÝN¨: Copyright (C) Dovetailed Technologies, LLC. 2005-2018. All rights reserved.
CoZBatchÝI¨: executing progname=login-shell="-/bin/sh"
CoZBatchÝI¨: returning rc=exitcode=0


Regards,

George viju
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP thru COZBATCH

Post by dovetail »

Since your output doesn't show that cozsftp is even being started, my best guess is that you have a JCL problem.

The recommended approach is to use our sample batch JCL/proc/script documented here:
https://coztoolkit.com/docs/sftp/client ... ient-batch

For example:

Code: Select all

//SFTPCONN EXEC PROC=SFTPPROC 
//SFTPIN DD * 
pwdsn="COZUSER.COZ.SAMPJCL(PW)" 
user=myuser
host=myhost 
lzopts="mode=text"
rdir="/app/data/"
rfile="remotefile.txt" 
                                                            
. $script_dir/sftp_connect.sh <<EOB
lzopts $lzopts
-mkdir $rdir
cd $rdir
ls -al
get $rfile //DD:MYDD
EOB 

//MYDD  DD DSN=COZUSER.SFTPGET.DATA,DISP=(MOD,KEEP), 
//        DCB=(LRECL=80,RECFM=FB),SPACE=(CYL,(3,1)) 
//*   
Post Reply