Write to Joblog

wrtJobLog

The wrtjoblog procedure is a utility to output an information message the joblog.

The wrtjoblog procedure can send a string of text to the job's joblog as an informational message. Up to 16 optional substitution variable may be specified and inserted in the the message text at runtime.

void  wrtjoblog(
  szMsg                    *  Value OPTIONS(*STRING)
  szSubstitutionValue1     *  Value OPTIONS(*STRING : *NOPASS)
  szSubstitutionvaluen...  *  Value OPTIONS(*STRING : *NOPASS)
  ... up to 16 substitution values may be specified
)

See also: WrtTrace

Parameters

szMsgPattern
[input Char(*) value]  Any variable or literal that is to be written to the joblog.  If the value contains substitution variables, then the value from the subsequent parameters is inserted in order into this value before it is written to the joblog.
 
szSubstitutionValuen...
One or more character string values that are inserted into the szMsgPattern parameter where ever a %s literal is detected (see example). Up to 16 substitution values may be specified. Each value must be character format. For numeric values, convert them to character by enclosing them in the %CHAR built-in function.

Return Value

The return value is *ON ('1') is the procedure was successful, otherwise *OFF ('0') is returned.

 

Example

.....C*Rn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++
     C                   callp     wrtjoblog('Customer: %s Balance due: %s' : 
     C                                   %char(CustNo) : %char(BALDUE))

In this example the two numeric values CUSTNO and BALDUE are converted to character using %CHAR and used as substitution values in the joblog string. Of course non-numeric values may be specified without enclosing them in the %CHAR built-in function.

If CUSTNO = 3741 and BALDUE = 65.00 the message written to the joblog would be as follows:

Customer: 3741  Balance due: 65.00