Page 1 of 1

SYSTEM_COMMAND and Messages

Posted: Wed Mar 22, 2017 7:14 am
by jyoung
I am using the builtin SYSTEM_COMMAND to change library lists as such

Code: Select all

#command := "CHGLIBL libl(" + #libraryList + ")"
use builtin(SYSTEM_COMMAND) with_args(X #command) to_get(#STD_NUM)
I have noticed on my VLF-ONE command that when I receive the message queue when the call to the server module completes

Code: Select all

#avFrameworkManager.avReceiveSystemMessageQueue intomainform(False) requester(#COM_OWNER)
There is a "Library List changed." message in the queue.
library list changed.png
library list changed.png (1.77 KiB) Viewed 7396 times
I don't have any code that adds that as a message so I am assuming the CHGLIBL command is doing it. Every request has to set the library list so some commands have multiple requests to fill dynamic picklists and such so I end up with a few of these "Library List changed." messages.

Is there anyway to get it to stop? It is interfering with my other messages.

The documentation states that using X on IBM i is the same as running as S. Using B is the same as X run in the background and hidden on Windows but does not mention it running on IBM i.

Re: SYSTEM_COMMAND and Messages

Posted: Wed Mar 22, 2017 8:27 am
by MarkD
I think, but am not certain, that if you do a USE CLR_MESSAGES after system command will remove all current messages from the program message queue.

Re: SYSTEM_COMMAND and Messages

Posted: Wed Mar 22, 2017 8:48 am
by jyoung
Thanks Mark.

That seems to be working perfectly.

Re: SYSTEM_COMMAND and Messages

Posted: Wed Mar 22, 2017 10:43 am
by MarkD
Re "interfering with my other messages." - that's sometimes the problem with using CLR_MESSAGES.
If your messages were issued before the system command they will get cleared as well.

Re: SYSTEM_COMMAND and Messages

Posted: Wed Mar 29, 2017 3:55 am
by atostaine
If you issue this command before the CHGLIBL, you won't receive a message.

CHGJOB LOG(4 00 *NOLIST)

Unfortunately users might not have authority to use the command. In that case I would write a short CL that I could pass commands to, use CALL, and then handle those changes in there. You can compile the CL program to use adopted authority. If you signon the green screen and prompt the CHGJOB command, you can move the cursor to the top and press F1 for help. It will tell you the restrictions.

You should investigate the current values in your Job description so you can restore them after the CHGLIBL.

Art