ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Message file editing

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

  • Message file editing

    Hi there

    I am looking for a way to look at, find by partial description, modify and add messages to a message file. How in the world do I do that?

    I am new to all of this so please speak very slowly to me :P

    My manager suggested writing a bunch of CL programs to call from my COBOL program but that is not working out for me. I then found out about Message Subfiles, but cannot seem to get them to display. For example, I have SFLMSGKEY and SFLPGMQ(10) defined as FLDKEY and FLDPGM respectively. When I do this:
    Code:
    MOVE "1000" TO FLDKEY OF SFL-O
    MOVE "  MGKMSG01" TO FLDPGM OF SFL-O
    I end up with FLDKEY having a value of " MG" and FLDPGM having a value of "KMSG01SG01".

    At first I thought that FLDKEY and FLDPGM somehow redefine another field so I removed the second line. Now I move "1000" to FLDKEY and test it's value in DEBUG mode to see it is valued at " MG" IMMEDIATELY after moving "1000" to it!!!
    Go figure...

    Anyways, I don't understand what this field is supposed to do, anyways. If it is like SFLINDEX and you just set it to an index value, how do you determine the length of the message file to build the loop? If you are supposed to use it as a key, well, our message IDs are in the format MGK9999 where 9999 is a numeric index. Since FLDKEY is always a pic x(4), how does one use this field?

    In fact, how does one display the message file without it bombing out the entire program and logging oneself out of the AS/400???

    I saw the option to read the entire message file in one operation, but wether I do it that way or just read a single message, my program bombs out immediately and logs me off of the AS/400.

    From what I have read, using a message subfile will only display the messages in the message file, automatically using the entire width of the screen. How does one then select a message to modify? Simply type over it and hit enter? Obviously NEXT MODIFIED KEY isn't going to work. I saw a similar key for DDS but how does one issue a REWRITE to a message file?

    Any advice or sample code to help me in this task would be highly appreciated.

    Sincerely
    Jacco

  • #2
    Re: Message file editing

    FYI you can use WRKMSGF <F4> ou CHGMSGD <F4> to update or add a message in a message file.
    Philippe

    Comment


    • #3
      Re: Message file editing

      The problem is that our message files are currently standing at 1256 entries and as the new guy it is up to me to make sure the messages I want to use in my program don't already exist in the message files and if not, add them.

      This means paging through 1256 messages 8 at a time trying to find something that I can use... or just blindly adding new ones and ignoring all 1256 messages that already exist.

      My intent is to make my life easier in finding messages and to make life easier for all of us in updating the message files. For example, for every entry we make, we have to make the corresponding entry into another file where we translate it into the relevant language.

      Each time we make an entry we have to remember the number for that entry, go out of the message file, go into another message file, create another entry with the same ID as the previous one, go out, go into the previous one, go out go back into the other one, go out... bla bla bla

      In the last 3 programs I write I had a total of around 14 messages, 5 of which I found in the message file... Having to remember which 6 I am looking for while reading all 1256 (mind numbingly boring) messages... I can't concentrate that long so I need to scan the entire file for every message I want to add to my programs...

      This is just plain unproductive and to be honest, stupid...
      There HAS to be a search function for message files and since there isn't I wanted to find a way to CREATE one by reading the message file, putting it in a subfile and doing searches from there...

      The goal would be to (first of all) find messages quickly by being able to type in a partial description and using the evaluate command and (secondly) to be able to enter the messages in multiple languages and have them entered into the relevant files by hitting enter once...
      Last edited by CryingRaven; January 26, 2009, 06:51 AM.

      Comment


      • #4
        Re: Message file editing

        Hi CryingRaven:

        The following link has a few pgms whcih will allow you to dump a message file to a physical file. From there you can qry or sql to your hearts content.



        Best of Luck
        GLS
        The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

        Comment


        • #5
          Re: Message file editing

          Will have a look right now. Thx

          Comment


          • #6
            Re: Message file editing

            Hi CryingRaven:

            Do you know that you can use Merge Message File (MRGMSGF) command to set apart in a new message file the new messages that you add in a message file ?

            In this way you avoid the hassle of remembering the number for that entry, going out of the message file, etc.
            Philippe

            Comment

            Working...
            X