> -----Original Message-----
> From: IBM Mainframe Discussion List 
> [mailto:[EMAIL PROTECTED] On Behalf Of Salway, Nigel
> Sent: Thursday, February 22, 2007 3:26 PM
> To: IBM-MAIN@BAMA.UA.EDU
> Subject: How to FTP to mainframe using .NET Framework
> Dear Friends, 
> 
> I am helping a colleague set up a .NET Framework 2.0 FTP WEB 
> Request to ftp a file to a z\OS 1.4 system. The file should 
> end up in the Z\OS file system. Using some examples found on 
> the net, my colleague has been able to write a script that 
> will logon to z\OS (confirmed in the z\OS log), but then the 
> transfer request fails with a 501 message. The z\OS log shows 
> a security violation on an HFS structure which leads me to 
> believe the STOR request is trying to put the file into the 
> open system file system, not the z\OS file system.  The ID we 
> are using can FTP to the mainframe without problem if the FTP 
> is carried out manually from the Windows FTP client. 
> 
> I am curious to know if anyone can point us to a working 
> example on the net which shows a working syntax for this type 
> of transfer. 
> 
> TIA
> 
>    Nigel Salway

When you set up the ftp server parameters on the z/OS system, you tell
it whether to start up in the z/OS legacy dataset system or the UNIX
filesystem. This is the STARTDIRECTORY parameter in the "FTP.DATA"
parameter dataset or UNIX file: ask the person who set up the FTP daemon
on z/OS what it is. It can be either MVS or HFS, meaning normal DATASETs
or a UNIX file.

How is the user specifying the DSN in his VB program? Could [s]he try
enclosing it in "tick marks" (single quotes, apostropies or ')? If [s]he
does this, the entire DSN must be used, including the user's high level.
Unfortunately, I don't know if this is possible in VB.NET. I don't do
Windows programming. What needs to be sent is the equivalent of:

put windows.file 'USERID.WINDOWS.FILE'

Note that if you send a file which starts with a solidus (/), then the
ftp server will automatically switch to the HFS environment. That is, if
you do the equivalent of:

put /dir1/dir2/windows.file

it will try to put the data in the UNIX file "/dir1/dir2/windows.file".
Never specify a file that starts with or contains a solidus (/). That
is, have the program always do a "change directory" to the Windows
directory which contains the file to be transferred, then just use the
file name.

Some other information that may or may not be useful:

The z/OS FTP server determines whether to put something in a normal
DATASET or in a UNIX file based on the last "cd" command issued. If the
name after the "cd" command starts with a solidus (slash), then it
switches to UNIX. If it starts with a ', it switches to the legacy
dataset environment.

If possible, have them do a "manual" ftp using their userid and
password. Look for a message similar to:

203 USERID is logged on. Working directory is "USERID.".


The above message is when the default is for MVS datasets. If you see
somthing like:

203 USERID is logged on. Working directory is /u/USERID.

Then you are starting up in the UNIX filesystem world.

--
John McKown
Senior Systems Programmer
HealthMarkets
Keeping the Promise of Affordable Coverage
Administrative Services Group
Information Technology

This message (including any attachments) contains confidential
information intended for a specific individual and purpose, and its
content is protected by law.  If you are not the intended recipient, you
should delete this message and are hereby notified that any disclosure,
copying, or distribution of this transmission, or taking any action
based on it, is strictly prohibited. 

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to