Catch output in batchmode - Forum - OpenEdge Development - Progress Community
 Forum

Catch output in batchmode

This question is not answered

Hello,

Ist there a way to catch the "output" that is piped out of the prowin32.exe (in batchmode( in the ABL Session?

At the moment i pipe the output to a textfile with an external exe but i would like to catch the messages in the ABL Session.

All Replies
  •  
    Hi Sublam,
     
    I'm not sure if this is what you want, but you can catch all 4GL messages by using either client logging (startup parameters) or the LOG-MANAGER handle (in your code).
     
    -clientlog some_log_file_name_goes_here -logginglevel 4 -logentrytypes 4GLMessages
     
    LOG-MANAGER:LOGFILE-NAME = "some_log_file_name_goes_here".
    LOG-MANAGER:LOGGING-LEVEL = 4.
    LOG-MANAGER:LOG-ENTRY-TYPES = "4GLMessages".
    ... application code ...
    LOG-MANAGER:CLOSE-LOG().  /* if you need to close the log file to look at its contents */
     
    Brian
     
     

  • Hello Brian,

    Sadly that is not what i want.

    I want to "catch" the messages that are written by the prowin32.exe in batchmode through stdout (i guess) in the abl session.

    Like a "global" catch for all messages.

  •  
    Hi Sublam,
     
    Define "the messages".  What are these messages and what ABL statements create them?
     
    Brian
     

  • Error Messages for example.

    Afaik OE Pipes all Messages to the stdout (when batch mode is activated).

    Long story short: I wand to get everything that the prowin32.exe pipes out when batch mode is activated.

  • You mean you want to redirect your own default output stream to your own default input stream?

    Simon L Prinsloo

    www.vidisolve.com

  • If you are in an interactive session and you want to start a batch job and get its output, you can do this:

    INPUT THROUGH prowin32 -b -p mybatch.p.

    REPEAT:

     IMPORT UNFORMATTED cLine.

    END.

    INPUT CLOSE.

    Simon L Prinsloo

    www.vidisolve.com

  • Thank you for you answer Simon,

    Basically yes.

    The reason behind it is that i want to store the (error) messages in my OE database for our custom monitoring system.

    The answer you provided would work but i would really like to avoid doubling the number of running prowin32.exe processes on the server.

  • Sublam,
     
    I don't understand why capturing these Progress error messages using the LOG-MANAGER handle would not do what you want.  Yes, the resulting data would be in a file that you would have to process but no secondary process would be needed.  I think you need to give the LOG-MANAGER suggestion another look.
     
    I wonder if, even though you say that you "want to store the (error) messages" you mean your own custom messages and not the Progress messages (i.e. the ones that have an error number in parentheses).
     
    Brian
     
     

  • I mean the Progress Messages, i don't display any messages myself when in batchmode.

    I know that i could write the Messages to a file (and currently that is what i do).

    I was just wondering if there is a possibility to do this without a logfile.

  • Sublam,
     
    Sure there is.  Simply use NO-ERROR on every statement where it is an option, add a call to a routine that walks through error-status:num-messages and sends the messages to where ever you want them to go.  Is this clumsy and (from my perspective) painful?  Absolutely.  Using log-manager and processing the resulting file is cleaner.
     
    Brian

  • I guess i have to keep my logfile :(

  • Sublam,
     
    Yes, it does sound like it.  Sorry there is no better answer.
     
    Brian