CL and Commands

5 pts.
Tags:
Development
RPG
I have a CL that calls a command I created and the command references another CL that performs an SQL update to a file and then reruns the command. I'd like display a message (either update successful or error msg) on the bottom of the screen when the command runs again. CL THAT EXECUTES COMMAND: PGM BEGIN ? C41C920 MONMSG MSGID(CPF6801) EXEC(GOTO CMDLBL(ENDPGM)) GOTO CMDLBL (BEGIN) ENDPGM: ENDPGM COMMAND CMD PROMPT('Correct Inv. Location Quantity') PARM KWD(MCU) TYPE(*CHAR) LEN(4) RSTD(*YES) + DFT(5040) VALUES(5040) DSPINPUT(*YES) + CHOICE(*NONE) PROMPT('Cost Center ') PARM KWD(LITM) TYPE(*CHAR) LEN(25) PROMPT('Item + Number (CD SEQ 008028)') PARM KWD(FLOC) TYPE(*CHAR) LEN(20) PROMPT('From + Location (BB09141B )') PARM KWD(TLOC) TYPE(*CHAR) LEN(20) PROMPT('To + Location (BB09141 )') PARM KWD(QTY) TYPE(*CHAR) LEN(15) + PROMPT('Quantity on HAND')
ASKED: May 3, 2005  1:45 PM
UPDATED: October 24, 2010  6:02 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

SNDUSRMSG should work

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Kjmore
    SNDUSRMSG should work
    0 pointsBadges:
    report
  • TomLiotta
    It will depend on what kind of display file is active when you run your command. If the display file clears the message line, then it's going to be difficult. Consider this program example:
     pgm   ( +
             &pType       +
           )
    
       dcl   &pType       *char      1
    
    
    
     /*  Send a *COMP message to different places...                             */
    
       select
    
          when  ( &pType *eq '1' )  do
             sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                          msgdta( 'Type was 1       ' )  +
                          topgmq( *EXT )                 +
                          msgtype( *COMP )
          enddo
    
          when  ( &pType *eq '2' )  do
             sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                          msgdta( 'Type was 2       ' )  +
                          topgmq( *PRV (*CTLBDY) )       +
                          msgtype( *COMP )
          enddo
    
          when  ( &pType *eq '3' )  do
             sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                          msgdta( 'Type was 3       ' )  +
                          topgmq( *PRV (*PGMBDY) )       +
                          msgtype( *COMP )
          enddo
    
          when  ( &pType *eq '4' )  do
             sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                          msgdta( 'Type was 4       ' )  +
                          topgmq( *PRV (*PGMNAME *NONE TSTMSGCOMP) ) +
                          msgtype( *COMP )
          enddo
    
          otherwise  do
             sndpgmmsg  msgid( CPF9898 ) msgf( QCPFMSG ) +
                          msgdta( 'Basic default    ' )  +
                          msgtype( *COMP )
          enddo
    
       endselect
    
    
       return
    endpgm
    Assume that the example program is named TSTMSGCOMP. Compile it and call it with:
    CALL TSTMSGCOMP PARM('0')
    The parm can be '1', '2', '3', '4' or some other value. As written, those first four values will cause a completion (*COMP) message to be sent in slightly different ways. Any other value sends a *COMP message in default form. Now, try calling the test program in three different ways:
    1. Call it from the system MAIN menu command line.
    2. Call it from a PDM command line.
    3. Press <F10> in PDM, and call from the QCMD command line.
    The different results for different values begins to show you that the way that the target of a message handles messages is what determines what happens to the message. If a message is going to be displayed, it's going to be displayed by a display file. If your program isn't the owner of the display file, then your program doesn't control where nor how the message shows up. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following