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:
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
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
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
Comment