Hi again Doug,

There is a pretty neat utility to easily display the contents of STDOUT. It is part an IBM document, https://www.ibm.com/support/pages/example-rpgle-program-calling-helloworld-java-program. Here are the relevant parts:

If you call the RPG program in an interactive job, you have to do some extra work to show the Java output, which is sent to the "standard output". Compile the RPG code in DSPSTDOUT.RPGLE at the end of this document and call that program to show everything that was sent to standard output in your job. It will show the most recent output first, and you can scroll up to see earlier output.

DSPSTDOUT.RPGLE: ILE RPG code to display the standard output. Create this program using CRTBNDRPG.

CTL-OPT ACTGRP(*NEW);
DCL-PR printf EXTPROC(*DCLCASE);
p POINTER VALUE OPTIONS(*STRING : *NOPASS);
END-PR;
DCL-PR getchar INT(10) EXTPROC(*DCLCASE) END-PR;
DCL-C EOL x'15';

printf (EOL);
getchar ();
return;

It works! In the session you have run the Java program in you can view the contents of STDOUT with CALL DSPSTDOUT.


-----Original Message-----
From: JAVA400-L <java400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Blalock, Bill via JAVA400-L
Sent: Monday, October 7, 2024 12:14 PM
To: Java Programming on and around the IBM i <java400-l@xxxxxxxxxxxxxxxxxx>
Cc: Blalock, Bill <Bill.Blalock@xxxxxxxxxxxxx>
Subject: RE: RUNJVA question

Hello Doug,

Have you tried overriding the STDOUT and STDERR into spool files?

OVRPRTF FILE(STDOUT) TOFILE(QSYSPRT) HOLD(*YES) OVRPRTF FILE(STDERR) TOFILE(QSYSPRT) HOLD(*YES)

I hope that helps.

-----Original Message-----
From: JAVA400-L <java400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of DOUGLAS ENGLANDER via JAVA400-L
Sent: Monday, October 7, 2024 12:01 PM
To: java400-l@xxxxxxxxxxxxxxxxxx; midrange-l@xxxxxxxxxxxxxxxxxx
Cc: DEnglander@xxxxxxxxxxxxxxx
Subject: RUNJVA question

I have a java program with several System.out.print(); commmands in it.


When I run the program interactively on a 5250 session using only the RUNJVA command, I see the various messages on the screen, as I expect, in the terminal window.

If, however, I run the same RUNJVA command within a CL and Call that CL in a 5250 session, I do not see the System.out.print() messages when the RUNJVA command executes. Why? What is suppressing these messages?

In addition, if I submit that CL to batch, I also do not see the messages.

I have tried the CL with OUTPUT(*PRINT) and/or OPTIONS(*VERBOSE), and still, there is no logging of the messages in either the job log, nor a spool file entry [which I was expecting with OUTPUT(*PRINT).

I have posed this question to IBM in a case on 10/3 and they are still working on it.

We are not at the bleeding edge of PTFs but fairly current and on V7R4.

Has anyone else experienced this or know why the system behaves like this?

Thank you,

Doug



"CONFIDENTIALITY NOTICE: This e-mail transmission (and/or the attachments accompanying it) contain confidential information belonging to the sender. The information is intended only for the use of the intended recipient. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on the contents of the information is strictly prohibited. Any unauthorized interception of this transmission is illegal under the law. If you have received this transmission in error, please promptly notify the sender by reply e-mail, and then destroy all copies of the transmission."
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l.
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
Message Encrypted via TLS connection
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/java400-l.
The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.
Message Encrypted via TLS connection

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.