×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi all,

I'm attempting to write to the joblog usng API Qp0zUprintf. I'm on V7 on
the IBM i.
My code follows:

* Procedure for writing to the joblog
D WriteToJobLog...
D PR 10I 0 ExtProc('Qp0zUprintf')
D szOutputStg * Value OPTIONS(*STRING)
D * Value OPTIONS(*STRING:*NOPASS)

d rc s 10i 0
d sqlString s 100a inz('CREATE PROCEDURE')
d COMPILEERROR c 'Compile error.'

/free

// Attempt to create the statement
Exec SQL
EXECUTE IMMEDIATE :sqlString;

// Check if it was created successfully
If sqlState = SQLSUCCESS;
// Do something
dsply 'Success' ' ';
Else;
errmsg = COMPILEERROR;
rc = WriteToJobLog('CREATE OR REPLACE PROCEDURE FAILED...' +
'\n' + X'25');
dsply 'BooHoo' ' ';
Endif;
/End-free

When I execute the WriteToJobLog procedure rc = 40 therefore 40 characters
were written. But when I display the joblog I can not see the message but I
do see the dspmsg BooBoo.

Can anyone see what I'm doing wrong?

Thanks,

Robert Rogerson

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.