Tapatalk

Reading FTP log output by script

Reading FTP log output by script

5

    Apr 15, 2016#1

    Hi there,

    I'm using the FTP of UltraEdit to connect to the JES system of our mainframe. The submitting of jobs and retrieving of the output works fine.
    Only the 'LIST' command doesn't work as I'm expecting it. Since JES sends, with the FTP command 'LIST', the list of all jobs in my spool I would expect this list under my FTP account in UltraEdit (just like a normal directory listing). But this doesn't work.

    Okay, as a workaround I would like to read with a script the output of the FTP log and elaborate the list in the script. Is there a way to read the log with a script?

    6,685587
    Grand MasterGrand Master
    6,685587

      Apr 15, 2016#2

      Yes, this is possible, but with one limitation:

      You have to select manually output window tab FTP Log before you run the script. It is (unfortunately) not possible from within an UltraEdit script to select the active output window.

      The script should contain as first lines:

      Code: Select all

      UltraEdit.outputWindow.showStatus=false;
      UltraEdit.selectClipboard(9);
      UltraEdit.outputWindow.copy();
      var sLog = UltraEdit.clipboardContent;
      UltraEdit.clearClipboard();
      UltraEdit.selectClipboard(0);
      UltraEdit.outputWindow.showStatus=true;
      Everything in active output window being hopefully the FTP Log is loaded via temporarily used user clipboard 9 to string variable sFtpLog for further processing by the script.

      Enabling showing status information in output window is important for debugging your script code because an error message resulting in stopping script execution is output by integrated JavaScript interpreter is written to the output window (tab 1 or 2 depending on which one was last active) only with output of status information being enabled.

      Note 1: It might be helpful to select explicitly a Server type on tab Server of FTP Account Manager to get the listing perhaps right interpreted.

      Note 2: There is on tab Server of FTP Account Manager the option LIST command filter which could be helpful to get the listing of your mainframe in a format understood by UltraEdit directly if your mainframe support list options.

      Note 3: There is on tab Advanced of FTP Account Manager the option Local - Perl regular expressions which could help to get the list of your mainframe better interpreted by UltraEdit.
      Best regards from an UC/UE/UES for Windows user from Austria

      5

        Apr 18, 2016#3

        Hey, thanks for the idea.

        The solution of the manual selection of the output window is not really applicable in my case. I wanna read through the whole result list in my FTP Log and perform in automatic an action. And I forgot to say, the starting point of the script should be a COBOL program. Therefore, the COBOL program has to be the active window.

        In fact Your 'note 2' and 'note 3' sounds interesting.

        If I would like to use the Local - Perl regular expressions, where do I have to put the expression? In the same input field like LIST command filter?

        And maybe more important, which format do I have to follow such that UltraEdit can display it?

        6,685587
        Grand MasterGrand Master
        6,685587

          Apr 18, 2016#4

          Well, the output window itself must not be the active window. A document/file window can be the active window. But the tab FTP Log in output window must be the active output window tab. But this small difference is most likely of no help for your task.
          bravedreamer wrote:If I would like to use the Local - Perl regular expressions, where do I have to put the expression? In the same input field like LIST command filter?
          And maybe more important, which format do I have to follow such that UltraEdit can display it?
          I asked myself nearly the same questions as I wrote my previous post. Unfortunately explanation for this option in help of UltraEdit is of no help.

          I looked on wodFtpDLX help as UltraEdit uses this library. There can be found the help for the properties DirFormat and ListParams, but I can't find anything about a local list interpretation by using Perl regular expression.

          So I think this is an extra feature added by the developers of UltraEdit whereby the regular expression is built-in and can't be customized by the user. I have never needed this option for myself and therefore don't know how it works. You could ask IDM support by email regarding this option if you are interested in more details.
          Best regards from an UC/UE/UES for Windows user from Austria

          5

            Apr 19, 2016#5

            Also to me seems like that UltraEdit has implemented the local list processing by using Perl regular expression inside itself.
            After all also the 'search an replace' command works with Perl regular expressions.

            In some documentation I saw the input field LIST command filter instead of in the tab server in the tab extension.
            So I though that maybe this field can contain also the regular expression. I tried it but with no success.

            Anyway, I try my luck with the IDM support.

            Thanks for Your help.