INPUT STREAM stream STREAM-HANDLE handle FROMopsys-fileopsys-deviceTERMINALVALUE ( expression )OS-DIR ( directory ) NO-ATTR-LISTLOB-DIR constant VALUE ( expression )BINARYECHO NO-ECHOMAP protermcap-entry NO-MAPUNBUFFEREDNO-CONVERTCONVERTTARGET target-codepageSOURCE source-codepageSTREAM streamSpecifies the name of a stream. If you do not name a stream, the AVM uses the unnamed stream. See the DEFINE STREAM statement reference entry and OpenEdge Development: Programming Interfaces for more information on streams.STREAM-HANDLE handleSpecifies the handle to a stream. If handle it is not a valid handle to a stream, the AVM generates a run-time error. Note that stream handles are not valid for the unnamed streams. See the chapter on alternate I/O sources in OpenEdge Development: Programming Interfaces for more information on streams and stream handles.The absolute or relative pathname of a file that contains the data you want to input. Any relative pathname is relative to the current working directory. Remember that UNIX file names are case sensitive. The pathname can contain Unicode characters. See OpenEdge Development: Internationalizing Applications for more information about Unicode.VALUE ( expression )OS-DIR (directory)Indicates that you want your input to be the filenames found in directory. The value of directory is a character expression specifying an operating system directory. This value can contain Unicode characters. If directory is not a directory or you do not have permission to read it, then the INPUT statement raises ERROR. Otherwise, the AVM generates the directory list and feeds it back to the calling program through the INPUT stream. An INPUT CLOSE statement discards any unread filenames from the list.
F — Regular file or FIFO pipe
D — Directory
S — Special device
X — Unknown file type
H — Hidden file
L — Symbolic link
P — Pipe fileIf you specify the NO-ATTR-LIST option, you will not get the attribute list for any line read from the input stream.
INPUT FROM OS-DIR("c:\mydir") NO-ATTR-LIST.Specifies the directory from which you want the IMPORT statement to read large object data files (such as BLOB and CLOB data files). The constant and expression arguments are character expressions that evaluate to an absolute pathname or a relative pathname (relative to the directory specified for opsys-file).If the specified character expression evaluates to either the Unknown value (?) or a directory that does not exist, or you do not have permission to read the specified directory, the AVM raises the ERROR condition.The LOB-DIR option is valid only when you specify an operating system file as the input data source.MAP protermcap-entry NO-MAPThe protermcap-entry value is an entry from the PROTERMCAP file. Use MAP to read from an input stream that uses a different character translation from the current 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). The AVM uses the PROTERMCAP entries to build a translation table for the stream. Use NO-MAP to make the AVM bypass character translation altogether. See OpenEdge Development: Internationalizing Applications for more information on PROTERMCAP and national language support.Allows you to modify the character conversions occurring between the external file and ABL. By default, the INPUT FROM statement converts characters from the code page specified with the Stream Code Page (-cpstream) parameter to the code page specified with the Internal Code Page (-cpinternal) parameter. If you specify SOURCE source-codepage alone, the conversion accepts source-codepage as the code page name of the external file (instead of -cpstream). If you specify TARGET target-codepage, the conversion accepts target-codepage as the internal code page (instead of -cpinternal). If you specify both SOURCE source-codepage and TARGET target-codepage, it converts characters from the source-codepage to target-codepage (instead of -cpstream to -cpinternal).TARGET target-codepageSpecifies the target 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 ABL uses for character management).SOURCE target-codepageSpecifies the source 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 ABL uses for character management).Instead of getting input from the terminal, this procedure gets input from a file named r-in.dat. The SEARCH function determines the full pathname of this file.
INPUT FROM VALUE(SEARCH("r-in.dat")).
REPEAT:PROMPT-FOR Customer.CustNum Customer.CreditLimit.FIND Customer USING INPUT Customer.CustNum.ASSIGN Customer.CreditLimit.END.INPUT CLOSE.This is what the contents of the r-in.dat file look like:
1 558002 413005 88000The PROMPT-FOR statement uses the first data item (1) as the CustNum and the second data item (55800) as the CreditLimit. The FIND statement finds the customer whose CustNum is 1 and assigns the value of 55800 as that Customer’s credit limit. On the next iteration of the REPEAT block, the PROMPT-FOR statement uses the value of 2 as the CustNum, the value of 41300 as the CreditLimit, etc.The INPUT CLOSE statement closes the input source, resetting it to the terminal. When you run this procedure, the data in the window is simply an echo of the data that the procedure is reading from the taxno.dat file. If you do not want to display the data, add the word NO-ECHO to the end of the INPUT FROM statement.
The BINARY option allows you to use the READKEY statement to read control characters from the input source without interpretation. For example, NUL (\0) does not terminate strings, CTRL+Z does not signal EOF, and CTRL+J is not converted to CTRL+M, but their binary values are provided directly.
If a line consisting of a single period is read, that is treated as if you pressed END-ERROR. If the period is in quotes (".") it is treated as an ordinary character.
92 "Match Point Tennis" "66 Homer Ave" "Como" ~"TX" 7543193 "Off the Wall" "20 Leedsville Ave" "Export" "PA" 15632
92 "Match Point Tennis" - "Como" "TX" 7543193 "Off the Wall" "20 Leedsville Ave" "Export" "PA" 15632
There is no CTRL+Z (EOF) embedded in the file.
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 ABL uses for character management).
If you specify a value of “undefined” for either source-codepage or target-codepage, no character conversion is performed.
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |