ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Working with message files

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

  • Working with message files

    Is there an easy way to dump the contents of a message file to an Excel spreadsheet? I need to review a message file to see if contains a message I can use and if not to see what message numbers are available to create a new message. Excel might be an easy format to view but is there a better way?

  • #2
    I guess if I use the DSPMSGD print option with *BASIC I can get what I need.

    Comment


    • #3
      I don't know of a good way to output to Excel, but *BASIC doesn't give you enough info, or you want something you can search, try outputting to a spooled file. (but not printing it) Then you can search/view the spooled file:
      Code:
      DSPMSGD RANGE(*ALL) MSGF(YOUR-MESSAGE-FILE) OUTPUT(*PRINT)

      Comment


      • #4
        Use the Message Queue API's to read through the entire message queue and filter the content based on your requirements. We do it in our HA4i product through a PHP interface, no need to use an Excel spreadsheet for storing the message queue content, just use the results from the API request. I used QGYOLMSG to get the messages to a UserSpace and then QGYGTLE to get each message so I could evaluate the message data.

        Chris...

        Comment


        • #5
          I do somewhat similar to Chris, though I simply loop over the QMHRTVM API and scan retrieved message texts for given strings. (Probably due to a "reading typo"...)The QGYOLMSG API would be appropriate for a *MSGQ rather than a *MSGF (...assuming *MSGF really was intended).

          However, if you really want to bring Excel into this for some reason and you want to do it with a spooled file, Consider the result of something like:
          Code:
          OVRPRTF FILE(QPMSGD) TOFILE(QPRINT)
          DSPMSGD RANGE(CPF9800 CPF9899) DETAIL(*BASIC) OUTPUT(*PRINT)
          Review the spooled result to see how it might help. It might or might not be sufficient depending on your need for 2nd-level text.
          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


          • #6
            addmsgd msgid(&p$msgib) msgf(&p$msglb/&p$msgfb) +
            msg(&msgtxt)

            goto cmdlbl(loop)

            /* ************************************************** ****************/
            /* löschen temporäre dateien */
            /* ************************************************** ****************/
            endfile: Dltf file(&templib/&msgfvon)
            monmsg msgid(cpf0000)

            /* ************************** */
            /* p r o g r a m m - e n d e */
            /* ************************** */
            ende: Endpgm

            Seems to be incomplete - Sorry! I'll copy it again if I have more time

            Birgitta
            Last edited by B.Hauser; August 18, 2016, 12:10 AM.

            Comment


            • #7
              Originally posted by tomliotta View Post
              I do somewhat similar to Chris, though I simply loop over the QMHRTVM API and scan retrieved message texts for given strings. (Probably due to a "reading typo"...)The QGYOLMSG API would be appropriate for a *MSGQ rather than a *MSGF (...assuming *MSGF really was intended).

              However, if you really want to bring Excel into this for some reason and you want to do it with a spooled file, Consider the result of something like:
              Code:
              OVRPRTF FILE(QPMSGD) TOFILE(QPRINT)
              DSPMSGD RANGE(CPF9800 CPF9899) DETAIL(*BASIC) OUTPUT(*PRINT)
              Review the spooled result to see how it might help. It might or might not be sufficient depending on your need for 2nd-level text.
              Ooops yes missed the message file bit.. I agree with the API to use.

              Comment

              Working...
              X