Page 1 of 1

Send a message to the joblog on IBMi

Posted: Thu Feb 17, 2022 2:38 am
by pkoopmanpk
On the IBMi we have a function that is running for a long time. So I'd like to display a message in the joblog at some key points in the program.

I tried:
  • Message MsgTxt('...') Type(*INFO)
  • Message msgid(CPF9898) msgf(QCPFMSG) Msgdta('...') Type(*INFO)
  • Use Builtin(ISSUEMESSAGE) With_Args('*TOPGMQ' 'M' 'CPF9898' 'QCPFMSG' '*LIBL' '...')
But none of those generated as message in the joblog.

I'm sure I'm missing a very simple point, but I can't figure it out.

Re: Send a message to the joblog on IBMi

Posted: Thu Feb 17, 2022 4:02 am
by Dino
The MESSAGE should be enough...

this program:

Code: Select all

FUNCTION   options(*direct)                             
BEGIN_LOOP #std_num to(100000)                          
IF         ('(#Std_num = 10000) *or (#std_num = 20000)')
MESSAGE    MSGTXT(TEST)                                 
ENDIF                                                   
END_LOOP                                                
produced this joblog when ran in batch:

Code: Select all

                                                       Display Spooled File                                                        
File  . . . . . :   QPJOBLOG                                                                             Page/Line   1/34          
Control . . . . .   -3                                                                                   Columns     1 - 130       
Find  . . . . . .                                                                                                                  
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+....0....+....1....+....2....+....3 
                                     Statement . . . . . . . . . :   170100                                                        
                                     Message . . . . :   Library list changed.                                                     
                                     Cause . . . . . :   The user library list was replaced by the specified list                  
                                       of libraries.                                                                               
DCM0425    Information             00   02/16/22  12:02:23.237696  DC@P9007     DCXPGMLIB   *STMT    QCMD        QSYS        01C8  
                                     From module . . . . . . . . :   DC@P9007                                                      
                                     From procedure  . . . . . . :   DC@P9007                                                      
                                     Statement . . . . . . . . . :   229                                                           
                                     Message . . . . :   TEST                                                                      
                                     TEST                                                                                          
DCM0425    Information             00   02/16/22  12:02:23.237749  DC@P9007     DCXPGMLIB   *STMT    QCMD        QSYS        01C8  
                                     From module . . . . . . . . :   DC@P9007                                                      
                                     From procedure  . . . . . . :   DC@P9007                                                      
                                     Statement . . . . . . . . . :   229                                                           
                                     Message . . . . :   TEST                                                                      
                                     TEST                                                                                          
CPF1164    Completion              00   02/16/22  12:02:23.238505  QWTMCEOJ     QSYS        0161     *EXT                    *N    
                                     Message . . . . :   Job 125330/DCXMICKEY/PROCESO14 ended on 02/16/22 at                        
                                       12:02:23; .016 seconds used; end code 0 .                                                   
I have currently in my JOBD the next attributes:

Code: Select all

Message logging:                                             
  Level . . . . . . . . . . . . . . . . . . . . . :   4      
  Severity  . . . . . . . . . . . . . . . . . . . :   0      
  Text  . . . . . . . . . . . . . . . . . . . . . :   *SECLVL
Log CL program commands . . . . . . . . . . . . . :   *NO    
Job log output  . . . . . . . . . . . . . . . . . :   *JOBEND

Re: Send a message to the joblog on IBMi

Posted: Tue Jan 24, 2023 9:06 pm
by pkoopmanpk
Oops. :oops: I forgot to reply. Logging for this job was almost completely turned off in the job description. Thank you for your pointer.