Previous topic |
Next topic |
Contents |
Glossary |
Contact z/OS |
PDF
Data set record formats z/OS concepts |
|
Traditional z/OS® data sets are record oriented, and have one of five possible formats. In normal usage, there are no byte stream files such as are found in PC and UNIX® systems. (z/OS UNIX has byte stream files, and byte stream functions exist in other specialized areas. These are not considered to be traditional data sets.) In z/OS, there are no new line (NL) or carriage return and line feed (CR+LF) characters to denote the end of a record. Records are either fixed length or variable length in a given data set. When editing a data set with ISPF, for example, each line is a record. Traditional z/OS data
sets have one of five record formats, as follows:
We must stress the difference between a block and a record: a block is what is written on disk, while a record is a logical entity. The terminology here is pervasive throughout z/OS literature. The key terms are:
These terms are known as data control block (DCB) characteristics, named for the control block where they may be defined in an assembly language program. The user is often expected to specify these parameters when creating a new data set. The type and length of a data set are defined by its record format (RECFM) and logical record length (LRECL). Fixed-length data sets have a RECFM of F, FB, FBS, and so on. Variable-length data sets have a RECFM of V, VB, VBS, and so on. A data set with RECFM=FB and LRECL=25 is a fixed-length (FB) data set with
a record length of 25 bytes (the B is for blocked). For an FB data set, the
LRECL tells you the length of each record in the data set; all of the records
are the same length. The first data byte of an FB record is in position 1.
A record in an FB data set with LRECL=25 might look like this:
Positions 1-3: Country Code = 'USA' Positions 4-5: State Code = 'CA' Positions 6-25: City = 'San Jose' padded with 12 blanks on the right A data set with RECFM=VB and LRECL=25 is a variable-length (VB) data set
with a maximum record length of 25 bytes. In a VB data set, the records can
have different lengths. The first four bytes of each record contain the RDW,
and the first two bytes of the RDW contain the length of that record (in binary).
The first data byte of a VB record is in position 5, after the 4-byte RDW
in positions 1-4. A record in a VB data set with LRECL=25 might look like
this:
Positions 1-2: Length in RDW = hex 0011 = decimal 17 Positions 3-4: Zeros in RDW = hex 0000 = decimal 0 Positions 5-7: Country Code = 'USA' Positions 8-9: State Code = 'CA' Positions 10-17: City = 'San Jose' Figure 1 shows the relationship between records and blocks for each of the five record formats. |
Copyright IBM Corporation 1990, 2010
|