Directory type HFS for MVS files - CZCHKCMD exit

Discussion of Co:Z sftp, a port of OpenSSH sftp for z/OS
Post Reply
giltjr
Posts: 26
Joined: Wed Jul 07, 2010 9:06 pm

Directory type HFS for MVS files - CZCHKCMD exit

Post by giltjr »

Hello,

I tried our FTCHKCMD exit with your Co:Z SFTP and it appeared not to work. I caused a dump and it seems that when I am sending to a MVS file using put locfile.txt //mvsfile.name the directory type is set to HFS instead of MVS.

We are running 1.6.2 of your product. Is there any way that the directory type could be set to MVS for MVS files? This way our current exit could work ASIS.

-- Thanks.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

The IBM FTPCHKCMD exit has a really odd interface, and it can be confusing.

The "directory type" (parm 6 to FT/CZCHKCMD) is the type of the current working directory, and is not related to the type of the file, unless the filename is a "relative" name. This is consistent between IBM FTP and Co:Z SFTP.

So, in the following example the directory and directory type on the PUT will be HFS:

Code: Select all

sftp> cd /my/hfs
sftp> put local.file //HLQ.DSN
The equivalent in IBM FTP is:

Code: Select all

ftp> cd /my/hfs
ftp> put local.file 'HLQ.DSN'
The accurate way to properly determine the actual file type with IBM FTP (or Co:Z SFTP) in the CHKCMD exit is:

Code: Select all

- If the filename starts with "/" -> absolute HFS file
- else If the filename starts with single quote -> absolute DSN
- else if the (current) directory type is MVS:
    -> filename is DSN relative to directory
- else if the (current) directory type is HFS:
   -> filename is HFS relative to directory
giltjr
Posts: 26
Joined: Wed Jul 07, 2010 9:06 pm

Post by giltjr »

Thanks for the info. After reading your post I realized that for FTP we default to MVS not HFS as we do very little file transfers to HFS files.

Guess I be doing a little more additional work on my exit.
Post Reply