Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

FTP Script

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

  • FTP Script

    The script is in a source member - right? What I've done in the past is, I write a program that updates the source member with the file name that you need for the next FTP session. In fact, you could have your program write/re-write the entire FTP script member. I could find the code if you need it.

  • #2
    FTP Script

    I typically write an RPG program that reads parameters from a file (login, pwd, directory, etc) and builds the script on the fly. I generally create an FTPSCRIPT flat file in QTEMP to write to and have an FTPLOG file for the output to verify the results.

    Comment


    • #3
      FTP Script

      Jeff, You're right, its a source member. I need to update the source before I do the ovrdbf(input) and do the ftp(rmtsys) command. If you can send me the code, I will appreciate it a lot. Thanks. TIKI

      Comment


      • #4
        FTP Script

        Here's the code... Basically when you open a source file (In this case QFTPSRC) - the fields are SRCSEQ, SRCDAT, and SRCDTA. SRCSEQ is the key to the record, and SRCDTA is the actual data for each line. So, in this programs case, we knew that the UserID and password were on SRCSEQ "1" of the member, and the PUT command was on SRCSEQ "2". All the RPG program does is open the file, and read and re-write the record. Then the CL calls the FTP command after this RPG runs. Hope that helps.
        Code

        Comment


        • #5
          FTP Script

          Thanks a lot Jeff, I will try it. Tiki

          Comment


          • #6
            FTP Script

            Is there a way to override the FTP Script. We have an FTP script written on our AS/400. We are in need to change the file name every time we pickup the data from a server and ftp to as/400. See the script below. Thanks, TIKI
            Code

            Comment


            • #7
              FTP Script

              If I could just add a little to your suggestions, Jeff and Steve, the tweak I put on that is that in the sample script given above, I put an &KEYWORD in place of any variable portion of the script. Then I rebuild from first source file to second script file, line for line, then FTP with script and direct output to a third file to examine for error code. Files are multi-member, with app doing an override on all three files to same member. &KEYWORD is key into an options file to get value that is set by the app doing the FTP. It's not unusual to have two and maybe three &KEYWORD names embedded in the filename, plus maybe others such as directory, depending on requirements from customer. The app code needs to know about the options file fields that need set prior to doing the FTP, but other than that the FTP process is app independent. Changes can be made to each source member such as changing an IP address to a DNS name or changing login or password without any effect on programming. rd

              Comment

              Working...
              X