overriding default dataset attributes on remote z/OS system

Discussion of the COZBATCH utility for z/OS
Post Reply
dm9724
Posts: 4
Joined: Sun May 19, 2013 12:07 pm

overriding default dataset attributes on remote z/OS system

Post by dm9724 »

Attempting to send a dataset with the following attributes (LRECL=80,BLKSIZE=27920,RECFM=FB) to another z/OS system but the remote file is being allocated with the default attributes (LRECL=0,BLKSIZE=6144,RECFM=U). I thought I could override default attributes by coding lzopts but it is not working. Is this the correct method for overriding dataset attributes on the remote z/OS system? Any insight you can provide is greatly appreciated.
The following is the COZBATCH STDIN:
user=xxxxxx
host=xxxx
dcb="lrecl=80,blksize=27920,recfm=fb,space=trk.1.1"
lzopts="mode=text,servercp=IBM-1047,clientcp=IBM-1047,$dcb"
lfile="//xxxxxxx.xxxx.xxxx.TESTFIL1"
rfile="//xxxxxxx.xxxx.xxxx.TESTFIL1"
. $script_dir/sftp_put.sh

The following is the SYSOUT from COZBATCH job:
CoZBatchÕNþ: Copyright (C) 2005-2009 Dovetailed Technologies LLC. All rights reserved.
CoZBatchÕNþ: version 2.3.2 2013-03-15
CoZBatchÕIþ: executing progname=login-shell="-/bin/sh"
Connect using SSH defaults (keys)...
Executing: /usr/lpp/coz/bin/cozsftp -oConnectTimeout=60 -oServerAliveInterval=60 -oPreferredAuthentications=publickey
-oStrictHostKeyChecking=yes -b- xxxxxxx@yyyy
Co:Z SFTP version: 2.3.2 (5.0p1) 2013-03-15
Copyright (C) Dovetailed Technologies, LLC. 2011. All rights reserved.
cozsftp> lzopts mode=text,servercp=IBM-1047,clientcp=IBM-1047,lrecl=80,blksize=27920,recfm=fb,space=trk.1.1
blksize=27920 clientcp=IBM-1047 lrecl=80 mode=text
recfm=fb servercp=IBM-1047 space=trk.1.1
cozsftp> put //xxxxxxx.xxxx.xxxx.TESTFIL1 //xxxxxxx.xxxx.xxxx.TESTFIL1
Uploading //xxxxxxx.xxxx.xxxx.TESTFIL1 to //xxxxxxx.xxxx.xxxx.TESTFIL1
ZosDatasetÕIþ: Opening dataset xxxxxxx.xxxx.xxxx.TESTFIL1 for read with options: shr
ZosDatasetÕIþ: Closing dataset //xxxxxxx.xxxx.xxxx.TESTFIL1 - 100 records read, 1000 bytes sent
CoZBatchÕIþ: returning rc=exitcode=0
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: overriding default dataset attributes on remote z/OS sys

Post by dovetail »

BTW - this is really a question about Co:Z SFTP. COZBATCH is just a utility to run a z/OS Unix shell script in batch.

The lzopts command is used to set local options for the Co:Z SFTP client. As you have realized, this doesn't affect settings on a remote z/OS system.
To do that, you need to use either the zopts command or "ls /+" as with a generic sftp remote client.

The sftp_put.sh script isn't set up to send commands to issue a zopts command, so you would need to do something like this:

Code: Select all

user=xxxxxx 
host=xxxx 
lzopts="mode=text"
zopts="mode=text,lrecl=80,blksize=27920,recfm=fb,space=trk.1.1" 
lfile="//xxxxxxx.xxxx.xxxx.TESTFIL1" 
rfile="//xxxxxxx.xxxx.xxxx.TESTFIL1" 

. $script_dir/sftp_connect.sh <<EOB
lzopts $lzopts
zopts $zopts
put $lfile $rfile 
EOB 
You don't need to specify codepages, since Co:Z SFTP detects that Co:Z SFTP is on the other end and IBM-1047 is the default.
But there isn't a need to use text mode processing at all for z/OS to z/OS RECFM=FB.

Code: Select all

zopts="mode=binary,lrecl=80,blksize=27920,recfm=fb,space=trk.1.1" 
lzopts="mode=binary"
mode=binary is the default, but many sites have changed the default in their profile, so I have included it above.
If the dataset were recfm=v or fb or u, you would want something like this:

Code: Select all

zopts="mode=binary,l=rdw,lrecl=80,blksize=27920,recfm=fb,space=trk.1.1" 
lzopts="mode=binary,l=rdw"
dm9724
Posts: 4
Joined: Sun May 19, 2013 12:07 pm

Re: overriding default dataset attributes on remote z/OS sys

Post by dm9724 »

Thanks for your response. I had aslo coded zopts prior to this post with no luck. I submitted the COZBATCH job with the specifcations you recommended but the remote dataset is being allocated with the defaults. Any ideas?

COZBATCH input:
user=xxxxxx
host=yyyy
zopts="mode=binary,l=rdw,lrecl=80,blksize=27920,recfm=fb,space=trk.1.1"
lzopts="mode=binary,l=rdw"
lfile="//xxxxxx.xxxx.xxxx.TESTFIL1"
rfile="//xxxxxx.xxxx.xxxx.TESTFIL1"
. $script_dir/sftp_put.sh

COZBATCH SYSOUT:
oZBatchÕNþ: Copyright (C) 2005-2009 Dovetailed Technologies LLC. All rights reserved.
CoZBatchÕNþ: version 2.3.2 2013-03-15
CoZBatchÕIþ: executing progname=login-shell="-/bin/sh"
Connect using SSH defaults (keys)...
Executing: /usr/lpp/coz/bin/cozsftp -oConnectTimeout=60 -oServerAliveInterval=60 -oPreferredAuthentications=publickey
-oStrictHostKeyChecking=yes -b- xxxxxxx@yyyy
Co:Z SFTP version: 2.3.2 (5.0p1) 2013-03-15
Copyright (C) Dovetailed Technologies, LLC. 2011. All rights reserved.
cozsftp> lzopts mode=binary,l=rdw
l=rdw mode=binary
cozsftp> put //xxxxxxx.xxxx.xxxx.TESTFIL1 //xxxxxxx.xxxx.xxxx.TESTFIL1
Uploading //xxxxxxx.xxxx.xxxx.TESTFIL1 to //xxxxxxx.xxxx.xxxx.TESTFIL1
ZosDatasetÕIþ: Opening dataset xxxxxxx.xxxx.xxxx.TESTFIL1 for read with options: shr
ZosDatasetÕIþ: Closing dataset //xxxxxxx.xxxx.xxxx.TESTFIL1 - 100 records read, 8400 bytes sent
CoZBatchÕIþ: returning rc=exitcode=0
dm9724
Posts: 4
Joined: Sun May 19, 2013 12:07 pm

Re: overriding default dataset attributes on remote z/OS sys

Post by dm9724 »

I apologize , I missed your comment:
The sftp_put.sh script isn't set up to send commands to issue a zopts command, so you would need to do something like this:
I made the changes you recommended and it worked.


Thank you
Post Reply