| 
 | 
>If those commands are used from a
>command line only (thus interactively)
>you can implement the Retrieve Request
>Message API in the CPP.
Excellent idea Carel!
Here's an "F9=Retrieve" from one of my request processing CL programs:
             DCL        &MSGKEY *CHAR 5
             DCL        &MSGTYPE *CHAR 5
             DCL        &KEYVAR *CHAR 4
             DCL        &RTNTYPE *CHAR 2
             DCL        &CMD *CHAR 256
TAG001:
            SNDRCVF
            CHGVAR     &MSGTYPE '*LAST'
            CHGVAR     &MSGKEY  '*NONE'
            IF         &IN09 DO
 RTV001:
            IF   (&MSGKEY *EQ '*NONE') DO
                             RCVMSG PGMQ(*SAME)  +
                                    MSGTYPE(&MSGTYPE) +
                                    KEYVAR(&KEYVAR) +
                                    RMV(*NO) +
                                    MSG(&CMD) +
                                    RTNTYPE(&RTNTYPE)
                             MONMSG CPF0000 EXEC(GOTO TAG001)
            ENDDO
            IF   (&MSGKEY *NE '*NONE') DO
                             RCVMSG PGMQ(*SAME)  +
                                    MSGTYPE(&MSGTYPE) +
                                    MSGKEY(&MSGKEY) +
                                    KEYVAR(&KEYVAR) +
                                    RMV(*NO) +
                                    MSG(&CMD) +
                                    RTNTYPE(&RTNTYPE)
                             MONMSG CPF0000 EXEC(GOTO TAG001)
            ENDDO
                              IF (&RTNTYPE *EQ '  ') DO
                              CHGVAR &MSGTYPE '*LAST'
                              CHGVAR &MSGKEY  '*NONE'
                              GOTO TAG001
                              ENDDO
                              CHGVAR &MSGKEY &KEYVAR
                              CHGVAR &MSGTYPE '*PRV'
                              IF ((&RTNTYPE *NE '08') *AND +
                                  (&RTNTYPE *NE '10')) (GOTO RTV001)
                              GOTO TAG001
             ENDDO
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.