IBM i

Expand all | Collapse all

Is there a way to control STDOUT when using com.ibm.as400.access.ProgramCall

  • 1.  Is there a way to control STDOUT when using com.ibm.as400.access.ProgramCall

    IBM Select
    Posted Wed August 04, 2021 04:22 PM
    We use com.ibm.as400.access.ProgramCall to run iSeries programs from Java. One of those programs uses printf() to output diagnostics. When run from iSeries command line, the output goes to the screen, but when we run it through ProgramCall from Java, it goes to QPRINT. This causes issues with users that have a default printer set as it prints to their printer.

    ------------------------------
    Peter Vazny
    ------------------------------


  • 2.  RE: Is there a way to control STDOUT when using com.ibm.as400.access.ProgramCall

    Posted Thu August 05, 2021 04:07 PM
    Hi Peter,

    This is standard behaviour for JAVA / C objects. 

    See Java Invocation API and look for usage of QIBM_USE_DESCRIPTOR_STDIO and how it relates to STDIN, STDOUT & STDERR. You may be able to control the file names opened as FD[0], FD[1] & FD[2] and have these created so that they are routed to another output queue, are held automatically etc. 

    Hope this helps. 






    ------------------------------
    Keith Pryke
    ------------------------------



  • 3.  RE: Is there a way to control STDOUT when using com.ibm.as400.access.ProgramCall

    IBM Select
    Posted Thu August 05, 2021 04:21 PM
    Thank you. That is exactly what I was looking for.

    ------------------------------
    Peter Vazny
    ------------------------------