Browse Prior Art Database

Method for sorting z/OS files containing variable length records by control field locations relative to the end of a record

IP.com Disclosure Number: IPCOM000021699D
Original Publication Date: 2004-Feb-03
Included in the Prior Art Database: 2004-Feb-03
Document File: 3 page(s) / 43K

Publishing Venue

IBM

Abstract

The limitation imposed by the requirement that sort control field location must be specified relative to the beginning of an input record is circumvented by allowing a file to be sorted by control fields which are located relative to the end of the record. An intermediate file is created where the control fields have been appended to the front of the record. Because they are now at the front, the appended fields can be described by the SORT FIELDS parameter, and traditional sort can handle this intermediate file. Control statements are read to indicate where the control fields are and how long they are. Because it is control statement driven, this concept can be used to create a generalized utility which can be used to process any file containing variable-length records without any customized programming.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 47% of the total text.

Page 1 of 3

Method for sorting z/OS files containing variable length records by control field locations relative to the end of a record

Background

The ability to sort a z/OS sequential file or PDS member is a very common function. Tools such as SYNCSORT and DFSORT provide very generalized, control statement driven functions for performing such sorts. A 'SORT' control statement is accepted by these products, in which the descriptions of the control fields by which record is to be sorted is provided. The following components are specified in on the FIELDS parameter of the SORT control statement:
(p,m,f,s) where: p indicates the first byte of a control field relative to the beginning of the input record m indicates the length of the control field f indicates the physical format of the control field s indicates how the control field is to be ordered

In many instances, the above 4 sub-parameters are sufficient to describe a control field in a record; however, in the case of a variable length record, the records may be formatted such that the fields of interest for sorting are trailer fields which have a fixed location, relative to the end of the record instead of the beginning. For example, IMS log records have a trailing time stamp and trailing sequence number which, while they may have different locations relative to the beginning of the record, the location is fixed and predictable relative to the end. A limitation of the sort tools is that, in such cases, the above sub-parameters on the FIELDS parameter cannot define the control field, and the record cannot be sorted by this control field.

The only known way around this problem is to write application code or sort exits to perform the desired sort operation.

The current invention circumvents this limitation of the FIELD parameter and allows a file to be sorted by control fields which are located relative to the end of the record by creating an intermediate file where the control fields have been appended to the front of the record. Because they are now at the front, the appended fields can be described by the FIELDS parameter, and traditional sort can handle this intermediate file. The invention reads control statements which indicate where the control fields are and how long they are. Because it is control statement driven, the invention is a generalized utility which can be used by any file containing variable-length records without any customized programming.

Summary

The invention works through a three step process:

1) Run a preprocessor step in which some control statements are provided to indicate:

a) Location of the first byte of the control field(s), relative to the end of the record.

b) Length of the search fields.

1

Page 2 of 3

The invention then creates an intermediate file in which the control fields from

each record have been extracted and appended to the front of each corresponding

record.

Each new record now has the following new characteristics:

a) An additional copy of the cont...