new user help : ls -al and get and PDS binary transfers

Discussion of the COZBATCH utility for z/OS
Post Reply
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

new user help : ls -al and get and PDS binary transfers

Post by carls »

I am a new user and could use some help and information.

1. PDS or PDSE binary transfers do not seem to be supported, like MVSGET or MVSPUT under ftp, is this correct?
I have been reading your doc and forum content. It seems PDS and PDSE transfers are text only.
Which would mean we should terse an PDS or PDSE where members have any binary data, is this correct?

2. using 'get' to transfer a dataset on a remote z/OS, to local z/OS, seems to require setting all dcb information (using ls/+ or lzopts or zopts).
you also have to set primary and secondary allocation and maxvol. I am trying to understand how to do that.

I would like to wrap REXX around using get (to make it easier on colleagues) by extracting remote data set information and generating the CoZ
command stream.

I can see the ls -al command can show basic dcb information.

I see only one example of ls -al output. I do not see documentation of the command output, so I have questions.
a. is there ls -al documentation of the output?
b. presuming there is no doc, can ls -al show the dsntype (ie LARGE) or number of volumes? (is important for allocating on local z/OS)
c. can you show an example of how to use ls -al to retrieve the remote data set's dscb information and pass to a REXX program some how?
I am not a USS user, if I can get ls -al command output in to a z/OS data set (not USS file) - then REXX can read and parse and I can generate
a CoZ command stream.

Thank you, Carl
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by dovetail »

RE: 1. You can transfer individual PDS or PDSE members in binary, but not the entire partitioned data set at once.

For z/OS to z/OS transfers, you generally want to do this to set binary mode, with length-prefix record separators:

# both local and remote options need to be set
lzopts mode=binary,l=l4
zopts mode=binary,l=l4

Then if you want to copy PDS members, this is one way:

lcd //my.local.pds
cd //my.remote.pds
put AMEMBER # single
put * # all members

RE 2.
For copying sequential data sets z/OS to z/OS, see the new "dsput" and "dsget" commands (added in Release 5.5.0)
These automatically handle setting options and target DCB parameters to match the source.
Currently dsget and dsput only handle sequential data sets and not PDS/E.

See:
https://dovetail.com/docs/sftp/client.h ... t-ds_trans
Example: Transfer data sets between Co:Z z/OS systems

https://dovetail.com/docs/sftp/cozsftp_ref.html
"dsget" and "dsput" subcommands
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by carls »

Hello,
Thank you for telling me about dsput, dsget. We are not at that release, so that will have to be a future thing we can look forward to. I do not know how far away that might be.

I have already been successful at transferring (put) sequential data sets and text PDS/PDSE.

That is why my questions were about 'get'. Until dsget is available to me, if I need to get 'get' working further (more generically), I would like to use ls -al (or write the dcb info separately on remote end and read it - which I have done but is a lot of work for each application). I would like to know how to have ls -al to be written to disk. Is that possible?

Thank you for your help!
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by carls »

Support,

I see only one example of ls -al output. I do not see documentation of the command output, so I have questions.
a. is there ls -al documentation of the output?
b. presuming there is no doc, i have to ask you. Can ls -al show the dsntype (ie LARGE) or number of volumes? (is important for allocating on local z/OS)
c. can you show an example of how to use ls -al to retrieve the remote data set's dscb information and pass to a REXX program some how?
I am not a USS user, if I can get ls -al command output in to a z/OS data set (not USS file) - then REXX can read and parse and I can generate
a CoZ command stream. Possibly have to have two separate command streams. Read would use first to issue la -a and get client log file to z/os data set, Rexx could read that and build second stream to get the data set.

Thank you
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by carls »

I found another post using piping, so I will try it :

//SFTPCONN EXEC PROC=SFTPPROC
//SFTPIN DD *
pwdsn="COZUSER.COZ.SAMPJCL(MYPW)"
user=myuser
host=myhost

. $script_dir/sftp_connect.sh <<EOB | todsn //DD:MYDD
ls -l
EOB
//

Thank you
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by carls »

Hello Support,

We are running Co:Z SFTP version: 4.5.1 (6.4p1) 2017-10-09

When I use ls -l I get extra fields but LRECL, BLKSIZE, RECFM are 0, for example, here are two invocations :

cozsftp> ls -l //MYTEST.TEST.SEQ.FB
-rw-rw-rw- 0 0 0 5479650 Dec 29 00:00 //MYTEST.TEST.SEQ.FB

cozsftp> ls -l //MYTEST.TEST.SEQ.VBA
-rw-rw-rw- 0 0 0 46800 Dec 31 00:00 //MYTEST.TEST.SEQ.VBA


If I leave off the -l then I get just the data set name, as expected.

Is there some setting we need for -l to return the DCB information ?

Thank you
Carl
carls
Posts: 10
Joined: Mon Jan 21, 2019 1:34 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by carls »

I forgot to add ...

the piping did not work. no error, no data written to //MYDD DD DISP=SHR,DSN=blah

The data set information is from the remote z/OS system. Is it trying to write over there?
I will enable loglevel=T and pull the error.log back. Maybe there will be a clue.

Thank you,
dovetail
Site Admin
Posts: 2025
Joined: Thu Jul 29, 2004 12:12 pm

Re: new user help : ls -al and get and PDS binary transfers

Post by dovetail »

If you want a "long listing" format (-l) for a z/OS data set that includes DCB, etc, then you must issue the command on a directory, and not a specific data set. This is because of how the underlying SFTP protocol packets differ in those two cases.

So try this:

sftp> cd //mytest.test.seq
sftp> ls -al

If you do the ls -al on a specific dataset, you will get a Unix-style long-listing, which doesn't include DCB, space, etc.

The information available on a dataset long listing is VOL, Referred, Ext, Tracks, Used, Recfm Lrecl Blksize and Dsorg, which is similar to what you see in ISPF 3.4. DSNTYPE is not included.

In your example:
. $script_dir/sftp_connnect.sh <<EOB | todsn //DD:MYDD
...

This works for me, so I don't know what your problem is without more details. It does have a problem though. If you pipe from the script, then the script will be forked in a separate OMVS address space, so you won't be able to use DDs in cozsftp commands.

PS> Technically, this is a Community forum and not product support.
For more information, see: http://dovetail.com/support.html
Post Reply