AS400 CL PGM Send a message to QSYSOPR and get reply from user to perform a process



PGM
DCL &MSGKEY  *char     4                               
DCL &RPLY     *char     1   ' '                         
                                                           
SNDPGMMSG MSG('Dont have enough Space. Type Y after clear some space or N to stop prcess (Y/N)') + 
             KEYVAR(&MSGKEY) MSGTYPE(*INQ)  TOMSGQ(QSYSOPR)
                                                           
RCVMSG MSGTYPE(*RPY) MSGKEY(&MSGKEY) WAIT(*MAX) MSG(&RPLY)     
                                                           
if (&RPLY = 'Y') do                                         
  sndpgmmsg 'Program Continue'
Enddo
 
if (&RPLY = 'N') do                                         
  sndpgmmsg 'Program Stopped'
Enddo

ENDPGM



Comments

Popular posts from this blog

AS400 : Add a new line in text in email SNDSMTPEMM

AS400 Display: Radio Button (SNGCHCFLD)

AS400 Display File: Check Box (MLTCHCFLD)