SFTP to Tape and DCB information

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
TGibson
Posts: 10
Joined: Thu Jul 06, 2017 11:08 am

SFTP to Tape and DCB information

Post by TGibson »

I'm writing data to Tape and passing the DCB information.
+mode=text,lrecl=3000,blksize=0,recfm=fb,unit=tape,mount

When I perform the transfer the second time and pass the same DCB information. The target dataset on the mainframe gets allocated with the following DCB.
Allocation
Record format :VB
Record length :1028
Block size :32760
TGibson
Posts: 10
Joined: Thu Jul 06, 2017 11:08 am

Re: SFTP to Tape and DCB information

Post by TGibson »

So when the dataset is written to tape and it accepts the DCB information I send it the first time it is written. If I retransmit to the same filename to TAPE the DCB is replaced with
Record format :VB
Record length :1028
Block size :32760

Where does this allocation come from in the processing? I was hoping that it would recreate the tape using the DCB I passed.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP to Tape and DCB information

Post by dovetail »

I can't say what this problem is without more diagnostic information.

Run the transfer and enable loglevel=T and then you should be able to see in the session log file a bpxwdyn log message with the exact parameters used for allocation.

(from a remote client:

sftp> ls /+loglevel=T
sftp> ls /+mode=text,lrecl=3000,blksize=0,recfm=fb,unit=tape,mount
sftp> put local.file //HLQ.TAPE.DSN
TGibson
Posts: 10
Joined: Thu Jul 06, 2017 11:08 am

Re: SFTP to Tape and DCB information

Post by TGibson »

Here is what I got. I can't find and message with bpxwdyn in the log.


ZosDatasetÝT¨: -> open("//c00605.fg.test.tape", 0x0091, 0x01B6)
CatalogSearchÝD¨: filterKey="C00605.FG.TEST.TAPE"
CatalogSearchÝT¨: -> search()
CatalogSearchÝT¨: search: total_length=65536, min_required=0, used=195, num_fields_plus_one=6, resume=
CatalogSearchÝT¨: <- search()
ZosSettingsÝD¨: Ý//-JES.*.ALL,ANY,U¨ does not match Ý'//C00605.FG.TEST.TAPE',PUT"
ZosSettingsÝD¨: Options in effect (no file pattern selected)
ZosSettingsÝI¨: Transfer options: blksize=0,clientcp=ISO8859-1,expdt=99000,lrecl=3000,mode=text,mount,recfm=fb,servercp=IBM-1047,trim,unit=tape
DatasetHandlerÝT¨: -> setDSN(C00605.FG.TEST.TAPE)
DatasetHandlerÝT¨: <- setDSN(effectiveDSN=C00605.FG.TEST.TAPE)
ZosDatasetÝD¨: InputBuffer: size=131072, useRecv=1, recvFlags=0x0
ZosDatasetÝI¨: Opening dataset C00605.FG.TEST.TAPE for write with options: mount old
DatasetHandlerÝT¨: -> open()
IEF233D M BCC1,I86653,,MDTFTP5,STEP1,C00605.FG.TEST.TAPE,
OR RESPOND TO IEF455D MESSAGE
IEC705I TAPE ON BCC1,I86653,SL,COMP,MDTFTP5,STEP1,C00605.FG.TEST.TAPE,MEDIA2
DatasetHandlerÝT¨: <- open()
ZosDatasetÝT¨: <- open()
Ý87.250¨ debug1: request 4: sent handle handle 0
Ý87.315¨ debug3: Type: SSH2_FXP_WRITE
Ý87.315¨ debug1: request 5: write "//c00605.fg.test.tape" (handle 0) off 0 len 32768
ZosDatasetÝT¨: -> write(off=0 len=32768)
ZosDatasetÝT¨: <- write(32768, recordCount=400, totalBytesWritten=32768)
Ý87.315¨ debug3: request 5: sent status 0
Ý87.315¨ sent status Success
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: SFTP to Tape and DCB information

Post by dovetail »

The problem is this: when you use Co:Z SFTP to allocate an existing data set, most of the DCB allocation parameters are not used.
This table shows which BPXWDYN allocation settings apply when writing to existing data sets:
https://dovetail.com/docs/sftp/options. ... ns_bpxwdyn

For DASD data sets this means that the existing DCB parameters in the VTOC will be used.
But for tape data sets, it turns out that the existing recfm/blksize/lrecl that is the tape label is not used by the access methods as it is with DASD.

So it is not currently possible to write to an existing cataloged tape dataset with Co:Z SFTP server and to supply DCB parameters.
It is possible to do this with the Co:Z SFTP client, by using a DD statement in your job step rather than dynamic allocation of the tape data set.

We will consider a future enhancement to allow DCB parameters to be supplied when writing to existing tape data sets.
Post Reply