MOPEN Function: z/OS

Opens a file by directory ID and by member name, and returns either the file identifier or a 0.
Category: External Files
z/OS specifics: File systems, open-mode
See: MOPEN Function in SAS Functions and CALL Routines: Reference


MOPEN(directory-id,member-name<,open-mode<,record-length <,record-format> > > )

Optional Argument

specifies the type of access to the file.
APPEND mode allows writing new records after the current end of the file. The A option is valid only for UNIX System Services. An error is returned if you specify A for a PDS or PDSE member.
OUTPUT mode defaults to the OPEN mode specified in the operating environment option in the FILENAME statement or function. If no operating environment option is specified, it allows writing new records at the beginning of the file.


MOPEN returns the identifier for the file, or 0 if the file could not be opened.
MOPEN applies to members in partitioned data sets (PDS and PDSE) and UNIX file system (UFS) files. Under z/OS, MOPEN can open PDS and PDSE members for output only. It can open UFS files for output or append.