z/OS DFSORT: Getting Started
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Data sets, records and fields

z/OS DFSORT: Getting Started
SC23-6880-00

The information you manipulate with DFSORT is contained in data sets. The term data set refers to a file that contains one or more records. Any named group of records is called a data set. The terms data set and file are synonymous, and are used interchangeably in this document.

A data set contains the information that you want to sort, copy, or merge. For most of the processing done by DFSORT, the whole data set is affected. However, some forms of DFSORT processing involve only certain individual records in that data set.

Data sets can be cataloged, which permits the data set to be referred to by name without specifying where the data set is stored. A cataloged data set should not be confused with a cataloged procedure. A cataloged procedure is a named collection of JCL stored in a data set, and a cataloged data set is a data set whose name is recorded by the system.

Throughout this document, the term record refers to a collection of related information used as a unit, such as one item in a data base or personnel data about one member of a department. The term field refers to a specific portion of a record used for a particular category of data, such as an employee's name or department.

DFSORT can sort, copy or merge fixed-length or variable-length records. The type and length of a data set is 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. For simplicity in this document, the terms "FB data set" and "FB records" are used as short-hand for fixed-length data sets and records, respectively, and the terms "VB data set" and "VB records" are used as short-hand for variable-length record data sets and variable-length records, respectively.

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. For a VB data set, different records can have different lengths. The first four bytes of each record contain the Record Descriptor Word or 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 000E = decimal 14
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'

Unless otherwise noted, the examples in this document process FB data sets, which are easier to work with and describe. However, special considerations for processing VB data sets are discussed throughout this document whenever appropriate.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014