Accessing z/OS UNIX files using QSAM

You can process byte-stream files in the z/OS® UNIX file system as ORGANIZATION SEQUENTIAL files using QSAM. To do this, specify as the assignment-name in the ASSIGN clause either a ddname or an environment-variable name.

ddname
A DD allocation that identifies the file with the keywords PATH= and FILEDATA=BINARY
Environment-variable name
An environment variable that holds the runtime value of the z/OS UNIX file system path for the file

Observe the following restrictions:

  • Spanned record format is not supported.
  • OPEN I-O and REWRITE are not supported. If you attempt one of these operations, one of the following file-status conditions results:
    • 37 from OPEN I-O
    • 47 from REWRITE (because you could not have successfully opened the file as I-O)

Usage notes

  • File status 39 (fixed file attribute conflict) is not enforced for either of the following types of conflicts:
    • Record-length conflict
    • Record-type conflict (fixed as opposed to variable)
  • A READ returns the number of bytes of the maximum logical record size for the file except for the last record, which might be shorter.

    For example, suppose that a file definition has level-01 record descriptions of 3, 5, and 10 bytes long, and you write the following three records: 'abc', 'defgh', and 'ijklmnopqr', in that order. The first READ of this file returns 'abcdefghij', the second READ returns 'klmnopqr ', and the third READ results in the AT END condition.

For compatibility with releases of IBM® COBOL before COBOL for OS/390® & VM Version 2 Release 2, you can also specify FILEDATA=TEXT when using a DD allocation for z/OS UNIX files, but this use is not recommended. To process text files in the z/OS UNIX file system, use LINE SEQUENTIAL organization. If you use QSAM to process text files in the z/OS UNIX file system, you cannot use environment variables to define the files.

related tasks  
Allocating files  
Defining and allocating QSAM files  
z/OS DFSMS: Using Data Sets (Using HFS data sets)