SYSTEM_COMMAND and Messages

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

SYSTEM_COMMAND and Messages

Post 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 7398 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.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: SYSTEM_COMMAND and Messages

Post 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.
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: SYSTEM_COMMAND and Messages

Post by jyoung »

Thanks Mark.

That seems to be working perfectly.
MarkD
Posts: 692
Joined: Wed Dec 02, 2015 9:56 am

Re: SYSTEM_COMMAND and Messages

Post 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.
atostaine
Posts: 696
Joined: Wed Jan 20, 2016 7:38 am

Re: SYSTEM_COMMAND and Messages

Post 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
Art Tostaine
Post Reply