Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

AS/400 FTP response codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • AS/400 FTP response codes

    I have an application that retrieves data from an AS/400. I am downloading a specific member from a file using GET file.member. If the file or member doesn't exist I want to catch the error code in my program so I can end gracefully. If the file is not there I get a 550 which is the standard responce. The AS/400 gives me a 426 if the member doesn't exist. In the AS/400 documentation this is listed as "connection closed; transfer ended abnormally". I have also received 426 when I have lost the connection. Is there anyway to know for sure that a member exists?

  • #2
    AS/400 FTP response codes

    Brian, Is there anyway to know for sure that a member exists? Change your script to add a LS or DIR command prior to the GET, naming just the library/file.member you are interested in. It should be fairly fast. Note however that you can't just look at the 3-digit codes returned. At the beginning you will get either "125 List started." or "125 Member XXXX not found in file YYYY in library ZZZZ." Then the listing (if any). Then the "250 List completed." Unfortunately you get 125 either way (at least on my V3R7 FTP server), whether you use LS or DIR. Doug

    Comment


    • #3
      AS/400 FTP response codes

      Actually we are using the LIST command currently. It seems to be causing a problem with our communications in certain situations so we want to eliminate it.

      Comment


      • #4
        AS/400 FTP response codes

        Brian I was also facing the same kind of problem. The solution I found to check code 150 and then just after this code if 250 or 226 are following, it means successful FTP. In all other cases unsuccessful FTP. Then the FTPLOG is printed to see the error messages. What kind of application you are using? Alam

        Comment


        • #5
          AS/400 FTP response codes

          Brian, Actually we are using the LIST command currently. It seems to be causing a problem with our communications in certain situations so we want to eliminate it. In that case you may want to switch to a different FTP client with better scripting support. Years ago, before VB even had a FTP control, I picked up a third-party FTP control for VB4 and have used it for all my custom transfers. It real easy to create programs which full control over error processing and dynamic decisions based on real-time feedback instead of looking at an output log after the fact. But today I'd recommend just using a better FTP client with conditional tests in the scripting support. There should be lots of them out there by now. One example would be from http://www.ipswitch.com which makes a popular GUI based FTP client but also bundles with it a scripting client with IF tests, error handling, etc. Doug

          Comment


          • #6
            AS/400 FTP response codes

            Thanks for the tip. I'll give that a try. This application runs on a Palm OS platform. It is an order entry system that uses FTP to transfer the data to our host system running on the AS/400.

            Comment

            Working...
            X