ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

FTP Savf to Lpar

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

  • FTP Savf to Lpar

    Recently the company that I work for set up a LPAR test environment. I'm attempting to create a CL program that will allow me FTP a savf between the test environment and production.

    When I process the CL, I do not get anything in the log file and the savf is not sent.

    Here is the code that I'm using:

    PGM

    CLRPFM FILE(TRANSFER/QFTPSRC) MBR(TOTESTLOG)

    OVRDBF FILE(INPUT) TOFILE(TRANSFER/QFTPSRC) MBR(TOTEST)
    OVRDBF FILE(OUTPUT) TOFILE(TRANFER/QFTPSRC) MBR(TOTESTLOG)

    FTP RMTSYS(MELTEST)

    DLTOVR FILE(*ALL)

    ENDPGM

    The library TRANSFER exists on the prod box as well as the Lpar.

    This is the Input file that I'm using:

    open 192.168.100.23
    user <username> <password>
    ! /******* Processed 04/12/2017 at 11:10:43 **********/
    CD TRANSFER
    LCD TRANSFER
    NAMEFMT 1
    BIN
    put LXPRODSAVF.savf
    ls *LXPRODSAVF*
    quit

    Any help would be most appreciated!

  • #2
    Try adding OVRSCOPE(*JOB) to your overrides of INPUT and OUTPUT and add LVL(*JOB) to the DLTOVR command.

    Comment


    • #3
      Just to add to this... I use OVRSCOPE(*CALLLVL).
      Also, the FTP command in your CL program will open the connection. You then use the open command in your FTP input file, FILE(TRANSFER/QFTPSRC) MBR(TOTEST). The open command will then fail because you opened the connection in the CL. FTP message is TCP1019 - Already connected to host 999.999.999.999.

      I am not sure if the script ends there or continues with the next command - you can test it yourself if you want.

      So I suggest you remove the open from your INPUT file and change
      user <username> <password>
      to
      <username> <password>.

      If that doesn't work, then I do have another solution for you - and although it's more user friendly, it's a bit longer and a bit slower in execution.

      Regards

      Kit
      www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT


      Regards

      Kit
      http://www.ecofitonline.com
      DeskfIT - ChangefIT - XrefIT
      ___________________________________
      There are only 3 kinds of people -
      Those that can count and those that can't.

      Comment


      • #4
        I tested using OVERSCOPE(*JOB) and OVERSCOPE(*CALLLVL). Neither made a difference.

        I also removed the OPEN from the INPUT file and removed the USER. These didn't make a difference either.

        Comment


        • #5
          I guess it's a pretty basic question, but can you ping MELTEST from your production machine?

          Cheers,

          Emmanuel

          Comment


          • #6
            Yes, I can ping from the production machine and I can even do the FTP manually.

            Comment


            • #7
              In that case, this may help (I don't think you want to be using namefmt 1):



              Cheers,

              Emmanuel

              Comment


              • #8
                Originally posted by pricele View Post
                When I process the CL, I do not get anything in the log file...
                What does that mean? Is the 'log' empty, or does it only have no indication of the transfer?

                BTW, "NAMEFMT 1" may be correct, though it'd be better if it was before the CD/LCD statements and if you used the same name format throughout. The way it is, it's not clear what names are actually expected. It might seem better to leave it out entirely and go just with default naming.
                Tom

                There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

                Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

                Comment


                • #9
                  Tom wrote: "BTW, "NAMEFMT 1" may be correct, though it'd be better if it was before the CD/LCD statements..."

                  It appears to me that TRANSFER is a library name (from the OVRDBF commands - incidentally, I just noticed that there's a typo in the library name on the second OVRDBF command). If that's the case, if you put namefmt 1 before the CD/LCD commands, I believe you'd need to use the naming convention indicated in the article link posted in my prior message:

                  /QSYS.LIB/libraryname.LIB/filename.FILE/membername.MBR

                  Cheers,

                  Emmanuel

                  Comment


                  • tomliotta
                    tomliotta commented
                    Editing a comment
                    I also assumed it was a library name. That would mean that the naming format would change for the CD/LCD commands, but resulting in consistency throughout the FTP script. Just personal preference. As it is, it's not clear why the NAMEFMT needs to change at all. Either drop the command entirely and use NAMEFMT 0 all the way through, or use NAMEFMT 1 all the way through.

                • #10
                  For the benefit of the OP, the NAMEFMT command tells FTP what file system naming convention you are using. NAMEFMT 0 indicates that you will be using the library file system naming convention, NAMEFMT 1 means you are using the /Root file system naming convention. This should be specified before any CD/LS etc etc type commands are run so the system knows what naming convention it should be using. NAMEFMT 0 is the default so is likely unnecessary in this case but I'm not sure what swapping naming conventions will do after your CD etc commands (don't think it does anything). I would therefore suggest moving it to the correct place (after the USER <username> <password> entry) and specifying the correct naming convention or removing it altogether.

                  To your problem though, as you have indicated that no log is produced (I assume this means the TOTESTLOG member has no records), I think that would mean that either your program fails before getting to the FTP step, or the overrides are not working. If you specify OVRSCOPE(*JOB) the override should work unless you have made a typo in the library/file/member name. Have you looked at the joblog for any errors?

                  Comment

                  Working...
                  X