smartFTP and the z/OS Unix File System

If you establish an ftp session with a z/OS (OS/390 or MVS) system, your root directory will be your userid and you will see all of the traditional z/OS data sets in the directory listing; for example userid.ISPF.ISPPROF. How can you switch over to the Unix File System (HFS) and view the traditional hfs files like /etc ?

I would also like the answer to this "problem".

We don't know how you can switch to to the HFS mode. I guess this question can be answered by your system administrator. If it can be done over FTP please let us know.

I just did some testing with my z/OS ftp server from an ftp prompt on another z/OS system. When I enter a cd /pathname I end up seeing HFS files. If I enter cd 'string1' I end up seeing traditional MVS datasets that have string1 as the high level qualifier. So my assumption is that doing a cd to a quoted string points me to MVS datasets and doing a cd string that beings with a / char puts me in HFS mode. Once I am in one of those modes, a cd with no quotes or / stays in the same mode. For example cd 'sys1' will show my working directory as 'SYS1.' If I then enter cd abc my working dir will be 'SYS1.ABC.' A cd .. will move me back to 'SYS1.' If I were to issue cd /sys1 my working dir would then be set to /sys1 in the HFS. A cd abc would place me into /sys1/abc , etc. Does this provide you with enough info to enhance SmartFTP to work with z/OS (MVS)?
--
DMagee[/b]

Does the same behavior work over FTP?

You can enable the command line in SmartFTP over the View menu. And then you can enter CWD balba or use the FTP->Change Directory command.

-Mat

Here is a log from SmartFTP:

Resolving host name sysa.xxx.com...
Connecting to (sysa.xxx.com) -> IP: 10.26.98.26 PORT: 21
Connected to (sysa.xxx.com) -> Time = 0ms
Socket connected waiting for login sequence.
220-IBM FTP, 10:36:41 on 2004-09-17.
220 Connection will close if idle for more than 5 minutes.
USER magee
331 Send password please.
PASS (hidden)
230 MAGEE is logged on. Working directory is "MAGEE.".
SYST
215 MVS is the operating system of this server. FTP Server is running on z/OS.
FEAT
211 no Extensions supported
REST 100
504 Restart requires EBCDIC data type.
TYPE I
200 Representation type is Image
REST 100
504 Restart requires EBCDIC data type.
PWD
257 "'MAGEE.'" is working directory.
Compression disabled for private IP addresses.
TYPE A
200 Representation type is Ascii NonPrint
PASV
227 Entering Passive Mode (10,26,98,26,7,225)
Opening data connection IP: 10,26,98,26,7,225 PORT: 2017.
LIST
125 List started OK
15791 bytes received successfully. (15.42 KB/s) (00:00:01).
250 List completed successfully.
Compression disabled for private IP addresses.
Cached directory reloaded.
CWD 'DDS2'
250 "DDS2." is the working directory name prefix.
PWD
257 "'DDS2.'" is working directory.
Compression disabled for private IP addresses.
PASV
227 Entering Passive Mode (10,26,98,26,7,227)
Opening data connection IP: 10,26,98,26,7,227 PORT: 2019.
LIST
125 List started OK
11125 bytes received successfully. (10.86 KB/s) (00:00:01).
250 List completed successfully.
NOOP
200 OK
CWD 'etc'
250 "ETC." is the working directory name prefix.
PWD
257 "'ETC.'" is working directory.
Compression disabled for private IP addresses.
PASV
227 Entering Passive Mode (10,26,98,26,7,228)
Opening data connection IP: 10,26,98,26,7,228 PORT: 2020.
LIST
550 No data sets found.

What I see in the log when I enter CWD commands is not what I am keying in. For example when I enter cwd /etc what shows up in the log is CWD 'etc'. The "/" char is gone and there are single quotes around etc. If this is the way it is passed to the z/OS ftp server, then z/OS is going to look for traditional MVS datasets that have ETC. as the first level qualifier of the dataset name. Per my previous post, if z/OS sees a quoted string, it switches to MVS mode. If it sees a non-quoted string that begins with a / it switches to HFS mode.
--
DMagee

Hmm thats interesting.

How do we detect if HFS is supported or not? Is there a safe way?

Would it be possible that you could provide us with a test account?

Regards,
-Mat

Checking on the test account for you but I wouldn't hold my breath if you know what I mean . Question: Is the text displaying in the log exactly what is passed from the client to the server? The use of both the single quote and double quotes in the SmartFTP log are confusing because I don't know which (if any) of thoses are being passed from the client to the server. And having the / character stripped out of my cwd /pathname was not what I expected to see in the log!! Another bit of information... I've talked about the z/OS FTP server being in either traditional MVS dataset mode or HFS (i.e., Unix file system) mode. The server flips between those two modes based upon receiving a Change Dir command with either a single quoted string with no / character (cwd 'string') or a more common unix like string preceded with a / character and no quotes of any kind (cwd /string). Well it turns out that the initial mode for the ftp server on z/OS is (Surprise! Surprise!) traditional MVS dataset mode. It can be set to initially be in HFS mode, but that is a global setting for the entire server that my company will not implement (to many existing processes already in place that would have to be changed).
--
DMagee

Note: Remember that a Change Dir cmd with no quotes or / characters causes the z/OS FTP server to continue in the current mode and traverse down to he next directory/folder (in HFS mode) or add another index level to the dataset name prefix (in MVS dataset mode). And a cd .. traverses back up one level in the respecitve mode.

BTW - Mat - That's a negative on getting a test account to work with .
--
DMagee

Hi, i have found a z/OS public ftp, but.... i don't see any failures with the last devel build with it.

ftp://ftp.emea.ibm.com/

I used SmartFTP to log into the site ftp.emea.ibm.com. The server is running in HFS mode as the default. This can be seen by the msg 257 "/" is the HFS working directory. that is displayed after the anonymous login.

Attempts to switch to traditional MVS dataset mode are failed by IBM's security controls, etc. For example I could issue cwd fromibm to traverse to the fromibm sub-directory but could not issue cwd 'SYS1' to list MVS datasets that begin with SYS1 without encountering an error msg.

I got the same results using my z/OS ftp client and by running ftp from the windows cmd prompt. It appears that SmartFTP may work fine in the default mode that the FTP server comes up in, but those of us supporting z/OS need to be able to switch between the MVS mode and the HFS mode.
--
Thanks in advance for your time in looking into this,
DMagee

Can you please do the following test and post the log.

Open command line in windows (cmd.exe)
then enter "ftp host"
log into the server
issue any cd command to switch to HFS. Does "cd ." work?
enter "pwd"

The log will help us to implement some kind of detection whether HFS or MVS is used on a ftp server running in MVS mode.

Thank you :-)

OK. Here you go....


Microsoft Windows 2000 [Version 5.00.2195]
© Copyright 1985-2000 Microsoft Corp.

C:Documents and Settingsmagee>ftp sysa
Connected to sysa.dillards.com.
220-IBM FTP, 10:10:26 on 2004-09-20.
220 Connection will close if idle for more than 5 minutes.
User (sysa.dillards.com:(none)): magee
331 Send password please.
Password:
230 MAGEE is logged on. Working directory is "MAGEE.".
ftp> cd /etc
250 HFS directory /etc is the current working directory
ftp> cd .
250 HFS directory /etc/. is the current working directory
ftp> pwd
257 "/etc/." is the HFS working directory.
ftp> cd 'SYS1'
250 "SYS1." is the working directory name prefix.
ftp> cd .
501 A qualifier in "." begins with an invalid character
ftp> exit

Hope the above helps...
--
David Magee

Thanks. Your log is helpful.

We'ill try to implement the old-MVS and the HFS mode by the reply of the CWD or PWD command. But you would still have to manually switch between the two modes.

What's the chance that a z/OS ftp server is supporting both modes? Is it something common or only available on newer builds?

Greets
-Mat

Thanks. Your log is helpful.  

We'ill try to implement the old-MVS and the HFS mode by the reply of the CWD or PWD command. But you would still have to manually switch between the two modes.

I would expect to have to manually switch ... not a problem.

What's the chance that a z/OS ftp server is supporting both modes? Is it something common or only available on newer builds?

Greets
-Mat

I do know that the current FTP server on z/OS 1.4 defaults to supporting both modes and switches between the two based upon receiving a DirChg (CWD) command in the appropriate format (see previous posts above). The default mode at start-up is traditional MVS dataset mode. Configuration directives and optional exits that may be implemented can change the default start-up to HFS mode and / or effectively turn off switching between the modes by not accepting certain formats of ChangeDir cmds, etc.

I currently have a request in to IBM to find out if this is a new feature or if it has been around since FTP was made available within the Unix System Services side of the operating system. I will update you when they respond.

Updated info: IBM's mainframe FTP server supportted both MVS dataset mode and HFS mode beginning with OS/390 2.10 (the last release before the name change to z/OS). OS/390 2.10 was announced in May of 2000 and became GA 4 months later in Septempber.
--
DMagee

Just to update those that are interested ... Thanks Mat! The current developer build is working with the z/OS FTP Server much better. Switching between MVS mode and HFS mode is quick. Just remember to use CWD instead CD. There are still some oddities when trying to work with members of a partitioned dataset but then again trying to make it mimic a directory with files in it is not apples to apples. I for one am looking forward to version 2 of the product.