Progress
Language Reference
OUTPUT THROUGH Statement
Identifies a new output destination as the input to a process that Progress starts.
SYNTAX
STREAM stream
The name of a stream. If you do not name a stream, Progress uses the unnamed stream. See the DEFINE STREAM Statement reference entry in this book and the chapter on alternate I/O sources in the Progress Programming Handbook for more information on streams.
program-name
The name of the program to which you are supplying data from a procedure. This can be a standard command or your own program.
VALUE ( expression )
An expression whose value is the name of a UNIX program to which you are supplying data from a procedure.
An expression is also the argument that you want to pass to the UNIX program. OUTPUT THROUGH passes the value of expression as a character string.
argument
An argument you want to pass to the UNIX program. The OUTPUT THROUGH statement passes this argument as a character string.
If the argument is the literal value paged, page-size, echo, no-echo, or unbuffered, you must enclose it in quotes to prevent Progress from using that argument as one of the PAGED, PAGE-SIZE, ECHO, NO-ECHO, or UNBUFFERED options for the OUTPUT THROUGH statement.
ECHO
Sends all input data read from a file to the UNIX program. Progress echoes data by default.
NO-ECHO
Suppresses the echoing of input data to the UNIX program.
MAP protermcap-entry | NO-MAP
The protermcap-entry is an entry from the PROTERMCAP file. Use MAP to send output to a device that requires different character mappings than those in effect for the current output stream. Typically, protermcap-entry is a slash-separated combination of a standard device entry and one or more language-specific add-on entries (MAP laserwriter/french or MAP hp2/spanish/italian, for example). Progress uses the PROTERMCAP entries to build a translation table for the stream. Use NO-MAP to make Progress bypass character translation altogether. See the Progress Client Deployment Guide for more information on PROTERMCAP. See the Progress Internationalization Guide for more information on national language support.
PAGED
Formats the output into pages.
PAGE-SIZE { constant | VALUE ( expression ) }
Specifies the number of lines per page. The expression is a constant, field name, variable name, or expression whose value is an integer. The default number of lines per page is 56. If you use the TERMINAL option to direct output to the terminal, the default number of lines per page is the number of lines of TEXT widgets that fit on the screen. If you specify a non-zero value for PAGE-SIZE, then the PAGED option is assumed. If you specify PAGE-SIZE 0, the output is not paged.
UNBUFFERED
Writes one character at a time to a normally buffered data source, such as a file. Use the UNBUFFERED option only when you can intermingle your UNIX output (with the Progress UNIX statement) and your Progress output (with the OUTPUT THROUGH statement). That is, the OUTPUT THROUGH statement manages the buffering of output between the Progress procedure the UNIX program that it invokes, but it does not handle the buffering of output to any other programs that the Progress procedure might also invoke.
CONVERT
Allows you to modify the character conversions occurring between the UNIX program and Progress. By default, the OUTPUT TO statement converts characters from the code page specified with the Internal Code Page (-cpinternal) parameter to the code page specified with the Stream Code Page (-cpstream) parameter. If you specify SOURCE source-codepage alone, the conversion accepts source-codepage as the code page name used in Progress memory (instead of -cpinternal). If you specify TARGET target-codepage, the conversion accepts target-codepage as the code page of the UNIX program (instead of -cpstream). If you specify both SOURCE source-codepage and TARGET target-codepage, it converts characters from the source-codepage to target-codepage (instead of -cpinternal to -cpstream).
TARGET target-codepage
Specifies the target code page of the character conversion (replacing -cpstream). The name that you specify must be a valid code page name available in the
DLC/convmap.cp
file (a binary file that contains all of the tables that Progress uses for character management).SOURCE target-codepage
Specifies the source code page of the character conversion (replacing -cpinternal). The name that you specify must be a valid code page name available in the
DLC/convmap.cp
file (a binary file that contains all of the tables that Progress uses for character management).NO-CONVERT
Specifies that no character conversions occur between the external file and Progress. By default, the OUTPUT THROUGH statement converts characters from the -cpinternal code page to the -cpstream code page.
EXAMPLESIn this example, the customer names are displayed. This output is sent as input to the UNIX
wc
(word count) command. The output ofwc
is directed to the file wcdata using the standard UNIX redirection symbol (>). Finally, the results are displayed as three integers that represent the number of lines, words, and characters that were in the data sent to wc.
The
r-othru2.p
procedure uses the UNIXcrypt
program, which accepts lines of data, applies an algorithm based on an encryption key and writes the result to the UNIX standard output stream, that can be directed to a file. The output from the procedure is directed tocrypt
, which encrypts the customer names based on the password, mypass. The results of the encryption are stored in the ecust file. Then, Progress decrypts and displays this file.
NOTES
- When you use the OUTPUT CLOSE statement to close an output destination used by an OUTPUT THROUGH statement, Progress closes the pipe, waits one second, and then continues.
- For any character conversions to occur, all of the necessary conversion tables must appear in
convmap.cp
(a binary file that contains all of the tables that Progress uses for character management).- If you specify a value of “undefined” for either source-codepage or target-codepage, no character conversion is performed.
- For more information on output destinations, see the Progress Programming Handbook .
SEE ALSO
DEFINE STREAM Statement, OUTPUT CLOSE Statement, OUTPUT TO Statement
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |