POSIX files are byte-oriented and contain no data records. BS2000 files, on the other hand, contain record-oriented and/or PAM block-oriented data.
POSIX handles files in EBCDIC format by default, while UNIX systems, MS-DOS and Windows files are in ASCII format. ASCII files stored in the POSIX file system have to be converted before they can be processed in the POSIX shell.
Copy and conversion routines are available so that files in either format can be used in both types of file system. Conversion is bidirectional between EBCDIC.DF.03 and
ASCII-ISO 7-bit code. Conversion is only meaningful for text files.
In addition, conversion routines are available so that files can be converted and inverted from the EBCDIC.DF.04 character set to the 8-bit character set (ISO 8859).
Automatic conversion
The environment variable IO_CONVERSION is used to control whether files accessed with POSIX commands (e.g. awk, cat, grep...) on mounted ASCII file systems are converted automatically. The environment variable IO_CONVERSION is set to “NO” by default, i.e. no automatic conversion takes place. Automatic conversion is enabled with the following command:
export IO_CONVERSION=YES
The following are handled as ASCII file systems:
Remote UNIX/Windows file systems mounted with NFS
Local POSIX file systems with POSIX file system marker=N
Remote POSIX file systems with POSIX file system marker=N which were mounted with NFS
To set automatic conversion as default for a POSIX user when the POSIX shell is started, the above export command must be entered in the .profile file in the home directory of the user concerned.
Automatic conversion must be disabled if one of the following tools is used as the tools include conversion:
dd, iconv or bs2cp with the -k switch.
Handling archives and libraries:
ar does not convert automatically since ar libraries often contain binary data.
pax and tar convert automatically. However, a pax or tar archive may not be copied with cp if automatic conversion is enabled.
Use the POSIX command bs2cp to transfer files from POSIX to BS2000. You can omit the -k option if the files are in EBCDIC format in both file systems.
You can set the file attributes for the BS2000 file. Before issuing the copy command bs2cp, use the POSIX command bs2file to define the attributes of the BS2000 file. bs2file is mapped to the BS2000 command SET-FILE-LINK.
Use the POSIX command bs2cp to transfer files from POSIX to BS2000. You can omit the -k option if the files are in EBCDIC format in both file systems.
The following must be noted, depending on the type of BS2000 file (SAM, ISAM):
You have the choice of storing a SAM file as a text file, a binary file or a binary text file in the POSIX file system. You set this definition using the POSIX ftype command before issuing the bs2cp copy command.
ISAM files are always stored as text files in the POSIX file system.