|
Robert,
I think you should be using Qp0zLprintf() rather than Qp0zUprintf().
At any rate, Qp0zLprintf() contains this information:
The data printed by *Qp0zLprintf()* is buffered one line at a time, and a
new message in the job log is forced every 512 characters if a new line
(\n)
is not detected in the data before that time. The buffer used by *
Qp0zLprintf()* is not physically written when the application ends. To
ensure messages are written to the job log, always use a new line (\n) at
the end of each *format-string*.
I've had problems with this as well, where it has buffered the data - I'd
try playing with your line delimiters - perhaps a CRLF?
Alternatively, just call QMHSNDPM (perhaps in a nice wrapper to avoid
havnign to specify all ythose pesky parameters?
Rory
On Thu, Jul 28, 2011 at 11:09 AM, Robert Rogerson <rogersonra@xxxxxxxxx
wrote:
Hi all,characters
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
were written. But when I display the joblog I can not see the messagebut
Ilist
do see the dspmsg BooBoo.
Can anyone see what I'm doing wrong?
Thanks,
Robert Rogerson
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
Rory Hewitt
http://www.linkedin.com/in/roryhewitt
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.