× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



.
As Rob implied for the example given, and it holds true for any command, that when a command is issued it is just calling another program. That called program then has control, instead of the program that requested to activate that command. Thus the program invoking the command no longer has any control to be able to issue status messages about progress of that command, because issuing a message requires the ability to call a program to effect that. In the case of the query example, the program QDBGETxx that is getting the records is periodically issuing status messages to indicate progress, because it is the program at the top of the stack doing work; programs lower on the stack simply await the 'return' from the program that it called.
The work would have to be divided into segments of activity to allow the requesting program to report the status of each segment of activity being performed. For example CPYF could be divided into several FROMRCD(&GroupStart) TORCD(&GroupEnd), where the SNDPGMMSG MSGTYP(*STS) would be issued between each _group_ of records. Since many other commands are not going to allow such segmentation, another approach would be required.
Another approach is to use events to interrupt the processing and gage progress by some inquiry, report the progress, then return to processing by returning from the interruption. This can be done by placing a *MSGQ in break mode in the job performing the work [CHGMSGQ DLVRY(*BREAK) PGM(named)], and then having another job send messages to that message queue [in break mode] periodically until the background job is informed to stop interrupting; i.e. after the request completes, it would need to inform the interrupt job to stop, just as it must inform the interrupt job to start prior to issuing the long running command. Note: for some invocations of CPYF this will not work, because the invocation may be effectively atomic and uninterruptible -- as well, I/O progress can not be gaged; this is true of any request the completes entirely _under_ the MI in the LIC.

Regards, Chuck
-- All comments provided "as is" with no warranties of any kind whatsoever.

c.chambers@xxxxxxx wrote:
<<SNIP>>
how can I kick off a command in a CL program and then monitor the
progress of that command and show that to the user - is there some magic
technique or do I have to rewrite the command in a high level language
and output appropriate message at each record count ? Is this what QRY +
OPNQRYF is effectively doing ?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.