Send a message to the joblog on IBMi

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
pkoopmanpk
Posts: 49
Joined: Wed Apr 26, 2017 7:12 pm

Send a message to the joblog on IBMi

Post 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.
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Send a message to the joblog on IBMi

Post 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
pkoopmanpk
Posts: 49
Joined: Wed Apr 26, 2017 7:12 pm

Re: Send a message to the joblog on IBMi

Post 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.
Post Reply