The most simple way  is to redirect your I/O to a TCPport where another job provides you with the expected input:
#1) have a listener:  (any port, I use 7777 for the example)

set listen="|TCP|7777"
open listen:(:7777):0  if '$test write "port busy",! quit
use listen read request
while request'="/*  your end condition */" {
    /* match request for correct reply */
    write reply,!

        }
close listen
     

#2) at your report side all you have to do is

set server =  "|TCP|7777"
open server:("127.0.0.1":7777):0
if '$test write "port busy",! /* termination sequence */ quit
use server

/* launch your program */

here the listener sits on the same machine but it could be any reachable IP-address.
the only critical point is if your program fiddles around changing $IO

 

it is not possible within the same class as you break the uniqueness of names.

But if you have class A1 with Method MX(....)  
you can create class A2 Extends A1 and overload Method MX as you like or need.
You still can call MX of class A1 from class A2 using ##super()

All with the assumption that neither class A1 nor Method MX is FINAL

Exactly!

here is the example Defining a JDBC Connection URL

   jdbc:IRIS://<host>:<port>/<namespace>

where the parameters are defined as follows:

  • host — IP address or Fully Qualified Domain Name (FQDN). For example, both 127.0.0.1 and localhost indicate the local machine.
  • port — TCP port number on which the InterSystems IRIS SuperServer is listening. The default is 51773 (or the first available number higher than that if more than one instance of InterSystems IRIS is installed — see DefaultPort in the Configuration Parameter File Reference).
  • namespace — InterSystems IRIS namespace to be accessed.

FIXED !

I have implemented an extension to %ZJSON.Generator to fix missing JSONTYPE

Standard Caché data types don't have a parameter JSONTYPE (!!) so everthing is set to (quoted) "string".
Especially numbers and boolean data must not be in quotes. 
       e.g  ....."NUMfield":124, "TrueFalse":true, ....  
instead of  ....."NUMfield":"124", "TrueFalse":"true", .... 


this extension bypasses the missing parameter for these standard data types as indicated in %ZJSON.Adaptor
/// number = %BigInt, %Currency, %Decimal, %Double, %Float, %Integer, %Numeric, %SmallInt, %TinyInt
/// boolean = %Boolean

For customized data classes it is easy to add  Parameter JSONTYPE=". . . ."
But changing sometihng in SYSLIB is a clear NO-NO to me.   ( though it might have been easier)

The extended version of %ZJSON.Generator is here:  
https://github.com/rcemper/Backport-JSON.-to-Cach-/blob/master/MissingJSONTYPE.xml

Some more findings what happens:
The output methods are code generated. And the generator just uses JSONTYPE from the data type class.
That means that even as the property parameter is available in Studio, ... you can't change it.

example: Property bool as %Boolean (JSONTYPE="string")  is just ignored  and you see ,"bool":false

This means: JSONTYPE is frozen in the data type class
Bringing Parameter JSONTYPE into the class (e.g, by %ZJSON.Adaptor) has no influence to the Generator 

To achieve the expected result you require a customized data class as suggested by  @Timothy Leavitt 

Out of 25 only these 7 6  classes are affected the rest is string which is default anyhow.

boolean %Library.Boolean.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.Currency.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.Decimal.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.Float.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.Integer.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.Numeric.cls(JSONTYPE): Parameter JSONTYPE 
number  %Library.PosixTime.cls(JSONTYPE): Parameter JSONTYPE  not in Caché