Functions and CALL Routines under z/OS |
Category: | External Files |
z/OS specifics: | files opened with FOPEN must be closed with FCLOSE |
See: | FOPEN Function in SAS Language Reference: Dictionary |
Syntax | |
Details | |
See Also |
Syntax |
FOPEN(fileref<,open-mode <,record-length <,record-format>>>) |
specifies the type of access to the file:
specifies the logical record length of the file. To use the existing record length for the file, specify a length of 0, or do not provide a value here.
specifies the record format of the file. To use the existing record format, do not specify a value here. Valid values are as follows:
B | |
D | |
E | |
F | |
P |
file contains printer carriage control in host-dependent record format. For data sets with FBA or VBA record format, specify 'P' for the record-format argument. |
V |
Details |
FOPEN returns a 0 if the file could not be opened. Under z/OS, files that have been opened with FOPEN must be closed with FCLOSE at the end of a DATA step; files are not closed automatically after processing.
FOPEN can be used to open ddnames with instream data that are not already opened if you specify 'S' for the open-mode attribute.
The default open mode for the FOPEN function is I, which means input but also implies random access. The I open mode is acceptable for a single-volume file because the NOTE and POINT operations can be performed internally. However, the operating system does not support NOTE and POINT across multiple volumes in a file. If you use the I open-mode attribute to open an external file that extends to multiple volumes, SAS flags it as an error at OPEN time. The best way to get around this problem is to specify S as the open-mode attribute to FOPEN. The S open-mode attribute requests strictly sequential processing, and no conflict occurs.
See FINFO Function: z/OS for code examples.
See Also |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.