Previous Topic: Reading Data from the TerminalNext Topic: Communicating with Database Procedures


Writing Data to the Terminal

To transfer data from program variable storage to the terminal screen, issue a WRITE TERMINAL statement.

If the output buffer has been dynamically acquired, you can optionally release that area by including a FREE STORAGE parameter in the WRITE TERMINAL request. The associated storage is released when the write operation is complete.

Output buffers that are explicitly acquired and released must be defined in the program's LINKAGE SECTION. h2.Determining if Asynchronous I/O Is Complete

When your program issues an asynchronous I/O request, DC establishes an ECB that is posted only after the requested I/O is complete. Before performing further I/O operations, you must issue a CHECK TERMINAL statement to determine if the ECB has been posted. If the ECB is unposted, indicating that the I/O is not complete, DC places the task in an inactive state. When the operation is complete, DC reactivates the task according to its established dispatching priority.

The CHECK TERMINAL statement must be used following all asynchronous I/O requests, regardless of mode. That is, mapping mode and line mode output requests that specify NOWAIT must issue a CHECK TERMINAL statement before issuing any subsequent I/O requests.