× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@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-2024 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.