SFTP with bachfile

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
cagatayucuzal
Posts: 40
Joined: Thu Jun 01, 2017 9:15 am

SFTP with bachfile

Post by cagatayucuzal »

Hello everyone,
we have a lot ftp jcl on mainframe. we want change to this file transfer sftp

Can we send cozsft job in jcl with batchfile? we installed and tried.

Because our file which send , file name is variable (not same every job)

Do you have any advice?



000020 //SFTPPUT EXEC PROC=SFTPPROC
000021 //SFTPIN DD *
000022 pwdsn=ÜS000.COZ.SAMPJCL(PW)Ü
000023 user=xxx
000024 host=x.y.z
000025 lzopts=Ümode=text,clientcp=IBM-1026,servercp=ISO8859-9,linerule=crlfÜ
000026 lfile=//xxxx.xxxx.yyy.ttt
000027 rfile=test
000031 sftp_opts=Üİsftp_opts -oPubkeyAuthentication=noÜ
000032
000033 . İscript_dir/sftp_put.sh
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP with bachfile

Post by dovetail »

The easiest way to handle this would be to have your data set pointed by a DD in the step and then use:

lfile=//DD:MYDD
cagatayucuzal
Posts: 40
Joined: Thu Jun 01, 2017 9:15 am

Re: SFTP with bachfile

Post by cagatayucuzal »

can we use same thing for rfile?
cagatayucuzal
Posts: 40
Joined: Thu Jun 01, 2017 9:15 am

Re: SFTP with bachfile

Post by cagatayucuzal »

rfile=/x/y/YYYZZZdatetime

YYYZZZdatetime this created by another rexx
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP with bachfile

Post by dovetail »

When you run cozsftp under COZBATCH, you are running a z/OS Unix shell script.

So, you can use shell script language to do something like:

rfile="/x/y/YYYZZZ.$(date +%Y%m%d.%H%M%S)"
Post Reply