Error 165 or 516 when running progress using in batch mode (-b)

« Go Back


EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: 10.x, 11.x
OS: All Supported Platforms
Question/Problem Description
Running OpenEdge batch session:
$   prowin32 -b
$   _progres -b
$   mbpro

Batch client terminates with one of the following errors:

** Attempt to write with no current output destination. (516)
** Attempt to write with no current output destination. (165)
Steps to Reproduce
Clarifying Information
Error Message** Attempt to write with no current output destination. (516)
** Attempt to write with no current output destination. (165)
Defect/Enhancement Number
This is expected behavior. 

The stdout stream was not redirected for the b
atch process, and the application code being run is putting data on the stream using DISPLAY, PUT or similar statements.  Unlike regular clients which by default direct the stdout stream to the terminal, the batch client does not have a default destination for this stream at all. 
There are two ways to handle this:

1. Ensure the stdout gets redirected on the OS level.

Easiest way to achieve that is to redirect the output to a file on the  the command line by 
adding a greater than sign followed by a filename.


$ _progres -b -p myProc.p > output.log

Other alternatives rely on the OS capabilities of setting up pipes between processes.

2. Ensure the stdout gets redirected from within the 4GL code.

To do this, use either OUTPUT TO or OUTPUT THROUGH statements without specifying a named stream.
This must be done before executing the statements that would cause output to be written to the stream.


OUTPUT TO report.txt.

FOR EACH customer:
   DISPLAY cust-num name address address2 city state country SKIP(2)

Last Modified Date9/13/2015 3:30 AM

The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.

Was this article helpful?


Your feedback is appreciated.

Please tell us how we can make this article more useful.

Characters Remaining: 255