Article

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

« Go Back

Information

 
EnvironmentProduct: Progress
Version: 9.x
Product: OpenEdge
Version: 10.x, 11.x
OS: All Supported Platforms
Question/Problem Description
Running OpenEdge batch session (with -b startup parameter)

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)
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
Cause
This is expected behavior. 

The stdout stream was not redirected for the b
atch process, and the process 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. 
Resolution
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. Example:  "_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 hat would cause output to be written to the stream.

Example:

OUTPUT TO report.txt.

FOR EACH customer:
   DISPLAY cust-num name address address2 city state country SKIP(2)
   WITH 1 COLUMN SIDE-LABELS.
END.

OUTPUT CLOSE.
Workaround
Notes
Attachment 
Feedback
 
Was this article helpful?

   

Your feedback is appreciated.

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



Characters Remaining: 255

 



Copyright © 1993-2014. Progress Software Corporation. All Rights Reserved. See the next generation of application development and data connectivity software, try now!