Try OpenEdge Now
skip to main content
Programming Interfaces
Input/Output Processes : Alternate I/O Sources : Processes as input and output streams (NT and UNIX only) : Portability issues
 
Portability issues
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".
END CASE.
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.
For information about the size limit of data files, see the input/output limits section of OpenEdge Deployment: Managing ABL Applications.