× 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.



At 08:17 PM 5/21/97 -0400, Tim wrote (in part):
>We have the CL below... This job was put together to hold up our
>S36 side processing until we are sure that several... jobs have completed
>running....
>
>       >Program Snipped<

Tim, you may want to consider the following alternate to your data area
approach.  The advantage is that you don't have your program spinning in an
infinite loop until the data area changes:



             PGM                                                        
             DCL        &MSG *CHAR 50
             DCL        &CNL *CHAR  1  VALUE(*)

             CHKOBJ MOVETEST *MSGQ
                MONMSG CPFxxxx    /* create msgq if it's missing */

 START:      RCVMSG MSGQ(MOVETEST) MSGTYPE(*ANY) WAIT(*MAX) +
                        RMV(*YES) MSG(&MSG)
             
             IF (%SST(&MSG 1 6) *EQ 'DSPLY ') THEN(DO)
                CALL yourprogram PARM(&MSG)
             ENDDO
      
             IF  (%SST(&MSG 1 1) *EQ &CNL) THEN(DO)
                GOTO END
             ENDDO
         
             GOTO START       
    
 END:                                                                       
             ENDPGM                                                     



Here's what it does:  Program tries to receive a message from message queue.
If no message is found, the WAIT(*MAX) parameter makes the system wait
forever until it -does- receive a message.

If the first 6 characters of the message are 'DSPLY ' the program will call
a program and pass the message as a parameter.  This part of the program is
not required in your application.

If the first character of the message is '*' the program will end.

The program will loop back to START: unless the '*' message is received.  

The difference is that the wait for a message is a system function and does
not take any resources until a message is actually received.

This program will wait and wait and wait until you end it by sending a message:

        SNDMSG '*'  TOMSGQ(MOVETEST)

The send message command can be inserted in any convenient CL or submitted
in a batch job.


--Paul E Musselman
PaulMmn@ix.netcom.com

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
* should be directed to the list owner / operator: david@midrange.com   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.