File types
On a Linux on x86 system, there are two types of files: stream files and binary files.
- Stream files
- Stream files are text files. The records of stream files are separated by
/n
. Stream files are viewable by operating system utilities such as vi, cat, or lpr. Examples of stream files are record sequential delimited (RSD) and line sequential (LSQ) data sets. - Binary files
- Binary files are raw files. The contents of binary files are entirely controlled by the applications that use the file. Binary files are readable only by an application that understands the format. Examples of binary files are QSAM and VSAM files.
In addition, Db2, CICS, and MongoDB provide file systems that the COBOL runtime can communicate with. Db2, CICS, and MongoDB files are binary files or raw mount points, which are entirely managed by Db2, CICS, and MongoDB applications. The contents of Db2, CICS, and MongoDB files are entirely invisible by the operating system provided tools; you can use Db2, MongoDB, or CICS tools like db2 show catalogue, mongodb show catalogue, sfsadmin list files, or cics schema to view the contents.
If you are moving COBOL programs between Linux on x86 and z/OS, you might also want to understand the file types of z/OS.
There are two different file types on z/OS:
- Sequential files
- Examples are QSAM, BSAM, and EXCP files.
- Relative or indexed files
- Examples are BDAM and VSAM files.