>>-readfile--pathname--stem------------------------------------><
Function
readfile invokes the open, read, and close callable services
to read from a text file and format it in a stem.
Parameters
- pathname
- A pathname for the file to be read.
- stem
- Upon return, stem.0 contains the number of lines read. stem.1 through stem.n (where n is the number
of lines) each contain a line read.
Usage notes
- The maximum allowable length of a line in the file is 1024 characters. RC=4 is returned when a line is greater than 1024
characters long or is not delimited with a newline character.The
contents of the stem is unpredictable.
- The newline characters that delimit the lines in a text file are
stripped before the lines are saved in the stem.
- When the return code indicates success, then Retval will be equal
to or greater than zero. It will also indicate the corresponding file
description number.
Example
In the following example, assume that
pathname was assigned
a value earlier in the exec:
"readfile (pathname) file."