FTP from unix to mainframe

Posted on 2006-04-22
Last Modified: 2008-01-09

I am trying to FTP a file from a unix server to mainframe. I have no idea how these main frames work
but I have been told to use a specific remote file name for that file which is AAAA.BB.CCCCCCCC.XXXXX.DDD
I used
ftp <remote server>
logged in and I was in
changed the local directory to the desired one where my file file1 is there using lcd
then typed

I got an error saying
501 Invalid data set name. Use Dsname conventions.

I tried using single quotes and double quotes

But the same error showed up.
Any help is much appreciated.

Question by:coolhusla1
    LVL 2

    Expert Comment

    Maybe this quote helps you :

    When you logged on you
    probably saw a message similar to: 230 xxxxxxx is logged on.  Working
    directory is "xxxxxxx.".

    To FTP the file to dataset on MVS you need three
    single quotes (''') on each end of the DSN, as in:
    put ourlibrary/ourfile.member ''''''

    Scott Ingvaldson
    AS/400 System Administrator
    GuideOne Insurance Group

    Author Comment

    Yes , it says that it logged on
    230 XXXX is logged on.  Working directory is XXXXX

    Now I tried to use
    put file1 '''AAAA.BB.CCCCCCCC.XXXXX.DDD'''
    It still says
    200 Port request OK.
    501 Invalid data set name .  Use MVS Dsname conventions.

    LVL 27

    Expert Comment

    Try to rename local file to AAAA.BB....
    then to put it there.
    Also possibly remote FS doesn't support such names and uses something like 8+3 naming convention.
    Please specify what is remtote mainframe OS/filesystem.
    LVL 57

    Expert Comment

    You need to check with somebody on the MVS side, normally the network system programmers.  A couple of pointers:

         By defualt you need to use a single quote on each end of the mainframe DSN.  'AAAA.BB.CCCCCCC.DDD' anything else will cause problems, not double quotes, not mutliple single quotes.  You company may have exits in place that require you to use something else, but by default it is single quotes.

         None of the levels on the MF name can start with a digit.  The levels are the things inbetween the dots.  That is you can have a name called 'MY.FIRST.DSN', but you can't have a file called 'MY.1ST.DSN'

        It is possible that the names must match a specific convention and you are not using that convention.  Such as the first level (AAAA) must be PROD or TEST and the mainframe people have coded an exit that returns the error you are getting when you use an invalid (based on company standards) DSN.

    Author Comment

    Thanks giltjr. I will try to find out about it from someone on their side.
    As you said one of the levels start with a number in my case. But that is the naming convention they suggested.
    I will ask them and let you know what the problem was.
    LVL 57

    Accepted Solution

    Well, numbers don't work.  I just tested to verify:

    ftp> put readme.txt 'xxxx.1.try'
    200 Port request OK.
    501 Invalid data set name "'xxx.1.try'".  Use MVS Dsname conventions.
    ftp> put readme.txt 'xxx.readme.txt'
    200 Port request OK.
    125 Storing data set xxxxG.README.TXT
    250 Transfer completed successfully.
    ftp: 2426 bytes sent in 0.05Seconds 48.52Kbytes/sec.

    MVS has had this restriction for a LONG time for files that are catalogs, which have been around and the standard for at least 20 years.  Now MVS has a "split personality".  It has the tradtional MVS type file names, "a.b.c.d", and it also support unix type names, "/a/b/c/d". When using unix type names names it has the same limitation/restrictions as unix, which means part of the name can start with a numeric.

    Author Comment

    NIce one giltjr. Their mistake. there was supposed to be a # before the number in that level. Now it works perfect.
    LVL 57

    Expert Comment

    Great, yes MVS does allow some special characters in DSN's and they can be the 1st part of a level.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, ( because one time I did this and I essentially had a bricked …
    Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now