File I/O
Your application can manipulate
CMS files using any of the following methods:
- Use record file system routines to manage SFS and minidisk files. See File I/O for more information on these routines.
- Use high-level language statements for opening, reading, writing, and closing files. When using a high-level language such as FORTRAN, COBOL, or PL/I, operating on files stored in SFS is the same as operating on files stored on a minidisk.
- Use these CMS FS macros to manage CMS files: FSCB, FSCBD, FSOPEN, FSREAD, FSWRITE,
FSPOINT, FSCLOSE, FSERASE, and FSSTATE.
These macros can manipulate files in SFS or on a minidisk. Applications written in a high-level language must call assembler subroutines that use these macros. See the z/VM: CMS Application Development Guide for Assembler for information on using the FS macros.
- Use the EXECIO command or the PIPE command command
to read
and write information. The PIPE command can be used from a REXX or EXEC 2 exec. The following stage commands, which are operands on the PIPE command, read and write records:
- <
- reads the contents of a CMS file.
- >
- writes to (replaces or creates) a CMS file.
- >>
- writes to (appends to or creates) a CMS file.
- FILEFAST
- reads from or writes to a CMS file.
- FILEBACK
- reads from a CMS file backwards.
- FILERAND
- reads specific records from a CMS file.
- FILESLOW
- reads from or writes to a CMS file beginning at a specified record.
The EXECIO command is normally issued from a REXX or EXEC 2 exec. See the z/VM: CMS Commands and Utilities Reference for details on the EXECIO command.
- Use OS and DOS simulated macros to manipulate files in SFS or on a minidisk. These OS and DOS simulated macros use the same CMS I/O routines that the FS macros do. See the z/VM: CMS Application Development Guide for Assembler for information on using OS and DOS macros simulated macros to access files.
Your application can manipulate BFS files using the following methods:
- Use OpenExtensions callable services. For more information about these routines, see the z/VM: OpenExtensions Callable Services Reference.
- Use the CMS Pipelines PIPE command. The PIPE command runs a series of stage commands called a pipeline. CMS Pipelines stages <, > and >> for reading and writing disk files transparently use the proper low-level device driver when the file is a BFS file. The low-level device driver will transparently transform between BFS data stream and records in the pipeline.
- Use CMS record file system CSL routines. This support is primarily for administration and system-managed storage purposes. See Manipulating BFS Files and Directories Using CMS Record File System CSL Routines.