SFTP PDS file from one z/OS CoZ LPAR to another

Discussion of the COZBATCH utility for z/OS
Post Reply
cjpete8
Posts: 13
Joined: Thu Aug 08, 2013 10:11 am

SFTP PDS file from one z/OS CoZ LPAR to another

Post by cjpete8 »

I'm attempting to create a batch job that will transfer a PDS file and it''s members from one mainframe LPAR running CoZ/SFTP to another. The files are transfered but it doesn't appear my options are being used. The file ends up on the target LPAR as sequential files (one file for each PDS member) with different blksize/lrecl. Here is my jcl


//SFTPPUT EXEC PROC=SFTPPROC
//SFTPIN DD *
pwdsn="myuserid.PASSWD(SITE1)"
user=MYUSERID
port=2222
host=plexut-u0
zopts="mode=text,dsntype=pds,lrecl=80,blksize=3120,recfm=fb,space=cyl.3.1"
lzopts="mode=text"
rfile="//MY.FILE.NETWORK.COZ.JCL"
lfile="//MY.FILE.NETWORK.COZ.JCL(*)"

. $script_dir/sftp_put.sh

//

Any ideas what I am doing wrong?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP PDS file from one z/OS CoZ LPAR to another

Post by dovetail »

It is a little tricky to upload / copy all members to a new remote PDS.
You really have to create/allocate the PDS by copying one member, and then copy the rest using a wild card.

Here is an example that uses a dummy one-line text file to create a DUMMY member:
...
lzopts="mode=text"
zopts="mode=text,dsntype=pds,lrecl=80,recfm=fb,space=cyl.3.1,dir=10"
lfile="//KIRK.COZ.TESTJCL(*)"
rfile="//KIRK.COZ.TESTJCL2"

. $script_dir/sftp_connect.sh <<EOB
lzopts $lzopts
zopts $zopts
put dummy.txt $rfile(DUMMY)
put $lfile $rfile
ls -al $rfile
EOB
(note also that I added "dir=10")

An alternative would be to do the first put of a known member of the PDS:
...
lzopts="mode=text"
zopts="mode=text,dsntype=pds,lrecl=80,recfm=fb,space=cyl.3.1,dir=10"
lfile="//KIRK.COZ.TESTJCL"
rfile="//KIRK.COZ.TESTJCL2"

. $script_dir/sftp_connect.sh <<EOB
lzopts $lzopts
zopts $zopts
put $lfile(KNOWN) $rfile(KNOWN)
put $lfile(*) $rfile
ls -al $rfile
EOB
cjpete8
Posts: 13
Joined: Thu Aug 08, 2013 10:11 am

Re: SFTP PDS file from one z/OS CoZ LPAR to another

Post by cjpete8 »

Thanks. I'll give it a shot.
Post Reply