Back to Summer Batch home page

Sort Tasklet

Summer.Batch.Extra.Sort.SortTasklet tasklet can sort or merge files using the syntax of DFSORT. It is useful when modernizing batches from z/OS mainframes. Only supported features are described in this section, see the DFSORT documentation for more details on the legacy syntax.

Specifying input and output files.  The input files are specified using Input property, which expects a list of resources, and output file is specified using Output property, which expect a resource. The encoding of input files can be set using Encoding property. If no encoding is specified, default encoding is used. All input files must have same encoding, which will be preserved in the output. If input files have header, it must be specified using HeaderSize property; this header will be reproduced in output file.

Reading and writing records.  A record is a unit of information that can be sorted. A sorted tasklet supports three types of records: (1) records separated by a character string (e.g., records separated by new line characters), (2) fixed-length records, and (3) records with a record descriptor word (RDW) specifying size. For separated records, the separator must be set with Separator property. For fixed-length records, the length must be set with RecordLength property. If none of these properties have been set, the tasklet will assume that records have an RDW.

Sorting files.  To sort files, sort card must be specified with SortCard property. If it is set, a comparer will be generated to sort records in input files, otherwise records will be kept in original order as in the input files. The sort card should respect DFSORT syntax (see section Supported DFSORT Features for more information).

Filtering records.  Records can be filtered using Include and Omit. Each property uses DFSORT syntax for records selection. Only records that are selected by Include and not selected by Omit will appear in output.

Transforming records.  Records can be transformed using Inrec and Outrec properties. Each property uses DFSORT syntax for record transformation. Records are transformed before and after they are sorted or filtered using Inrec and Outrec respectively.

Managing duplicates.  By default, all identical records will appear in output. The order among these identical elements in unspecified. If SkipDuplicates property is set to true, only one of identical records will be kept (the selection is also unspecified). It is also possible to sum the lines by setting Sum property with a DFSORT sum card.

Supported DFSORT Features

Sort Card

The sort card can either be a list of fields or specify a default format using the following syntax:


The fields should conform to DFSORT syntax, but only the following formats are supported:

As with sort cards, include and omit cards can either be a list of conditions or specify a default format:


The conditions should conform to DFSORT syntax and supports the following features:

The record formating in inrec and outrec cards only supports DFSORT “BUILD” syntax with following elements:

Back to Summer Batch home page