Skip to main content

Stream and Record Files

Files on a UNIX system are maintained by the operating system as streams (i.e., ordered, amorphous collection of bytes). For example, the 114th will result in return of the same data as long as the file has not been updated. Although various applications (e.g., a database manager) might organize the data into a different structure, neither the operating system nor any other non-specific application (including the UNIX LSAM) will have any knowledge of this structure. In contrast, operating systems on some platforms (e.g., OS2200) organize files into records. Records within a file may be of equal (fixed) or of unequal (variable) length. Records may be separated based on their length or by some particular sequence of data (e.g., a linefeed character). Applications read and write entire records at once, rather than individual bytes as with UNIX.

When a UNIX Agent receives a file, its default behavior is to ignore any record structure transmitted by the Server and to store the file as a stream file, as described in the preceding paragraph. If the file is subsequently requested to be transferred to its original system, or to any other system which supports the concept of records, it will be transferred as a structure-less stream of bytes. The receiving Server will do its best to give it some structure, but it may not be correct for the intended application.

A feature of SMAFT specific to UNIX platforms allows for retention of record structure so that files may be sent to a UNIX system from a non-UNIX system, and later retrieved by a (possibly different) non-UNIX system with the record structure intact. This feature is LSAM-specific and will not be usable by any application which may reside on the same system. If some application supports multiple platforms, it should include an import utility to make a file transferred from a non-UNIX system usable to it – and will need to be executed whether or not the SMAFT feature being described here was used to transfer the file.

This feature is invoked by pre-pending an equals sign ('=') to either the Source or Destination filename when filling in the Job Details screen in the Enterprise Manager (e.g., "=/usr/FMS/data/tn465.dat"). It should be noted here that only absolute pathnames are allowed (e.g., "./stuff.txt" and "~/this/that/other.data" are not allowed). As a visual indicator, the '=' sort of looks like: "divided into lines".

When '=' is pre-pended to the Source filename, it instructs the Server to send the record-structure data with the file. This means that the file must have first been transferred to the system and processed by the Agent as a record file (so that an ".idx" file exists). If the Server detects that this is not the case, it will abort the transfer with an appropriate message to the requesting Agent (which will be shared in some form with the user). The file may still be sent as a stream file by not pre-pending an equal sign to the Source filename.