Pascal_Osthus-bugat_1753

AS400 Agent -- how to adust UCEX_END to be operational?

Discussion created by Pascal_Osthus-bugat_1753 on Oct 30, 2016
If you intend to controle your AS400 with UCEX_END and UCEX_RUN, you will have to adjust the stop Programm UCEX_END before compiling it. The CLP-member delivered as per default by AUTOMIC has the following content:

================================================================================
 PGM        PARM(&EXECNR)                               
                                                        
 DCL        VAR(&EXECNR) TYPE(*DEC) LEN(6)              
                                                        
 DCL        VAR(&EXECNRA) TYPE(*CHAR) LEN(6)            
 DCL        VAR(&DTAQ) TYPE(*CHAR) LEN(10)              
 DCL        VAR(&DTAQL) TYPE(*CHAR) LEN(10) +           
              VALUE('AE_UC300')                         
 DCL        VAR(&LEN) TYPE(*DEC) LEN(5 0) VALUE(20)     
 DCL        VAR(&VAL) TYPE(*CHAR) LEN(20) VALUE('END')  
                                                        
 CHGVAR     VAR(&EXECNRA) VALUE(&EXECNR)                
 CHGVAR     VAR(&DTAQ) VALUE('DQ' *CAT &EXECNRA)        
                                                        
 CALL       PGM(QSNDDTAQ) PARM(&DTAQ &DTAQL &LEN &VAL)  
 ENDPGM                                                        
================================================================================                                   
This CLP cannot be used like this. THe parameter &EXECNNR is not necessary and the Dataqueue Object DTAQ name is only DQ.  To obtain an operational UCEX_END CLP you will have to adjust it as follows. .                                                

================================================================================
PGM                                                     
                                                               
DCL        VAR(&DTAQ) TYPE(*CHAR) LEN(10)               
DCL        VAR(&DTAQL) TYPE(*CHAR) LEN(10) +            
                    VALUE('UC4V11')                            
DCL        VAR(&LEN) TYPE(*DEC) LEN(5 0) VALUE(20)      
DCL        VAR(&VAL) TYPE(*CHAR) LEN(20) VALUE('END')   
                                                               
CHGVAR     VAR(&DTAQ) VALUE('DQ')                       
                                                               
CALL       PGM(QSNDDTAQ) PARM(&DTAQ &DTAQL &LEN &VAL)   
ENDPGM                                                  
================================================================================

The only relevant values is the values assigned to the variable &DTAQL. it must be the name of the library which stores the agent. In case the agent was installed in the library UC4V11, the UCEX_END-CLP should look like this before compiling       
       
To start and stop the agent, use then the following command lines

CALL PGM (UC4V11/UCEX_END) -- Stopping the Agent
CALL PGM (UC4V11/UCEX_RUN) -- Starting the Agent
      





Outcomes