Progress
Portability Guide


I/O with Other Processes

Use the INPUT THROUGH statement to pipe data into Progress from a UNIX or Windows NT process. Use the OUTPUT THROUGH statement to pipe data from Progress to another UNIX or Windows NT process.

You can also use the INPUT-OUTPUT THROUGH statement to pipe the output of a UNIX (or Windows NT) process into a Progress procedure and to pipe data from Progress back to that same UNIX (or Windows NT) process. This allows two-way communication to a program written at the operating system level. You might use this capability to do specialized calculations on data stored in a Progress database or entered during a Progress session.

To ensure portability, avoid using the INPUT THROUGH and OUTPUT THROUGH statements. In place of OUTPUT THROUGH, use the OUTPUT TO statement with an escape to the operating system, as shown in the following example:

OUTPUT TO file1.
      .
      .
      .
OUTPUT CLOSE.
CASE OPSYS:
   WHEN "UNIX" OR "Win32" THEN OS-COMMAND program-name < file1.
   OTHERWISE MESSAGE OPSYS "Operating system not supported". 

In this example, you send the data to file1. Then you use the appropriate operating system statement to escape to the operating system. Once at the operating system level, you run the program against the data in file1.

In place of INPUT THROUGH, use an escape to the operating system with the INPUT FROM statement, as shown in the following example:

CASE OPSYS:
   WHEN "UNIX" THEN OS-COMMAND program-name > file1.
INPUT FROM file1.
      .
      .
      .
INPUT CLOSE. 

First, you use the operating system statement to escape to the operating system. Once at the operating system level, you run a program to create the data in file1. Then you use the INPUT FROM statement to retrieve the data in file1.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095