Syncsort — File Split

Category: JCL and z/OS Utilities

Overview

How to use SYNCSORT to split files into multiple output datasets using SKIPREC, STOPAFT, and OUTFIL parameters.

Key Parameters

SKIPREC

SKIPREC=n instructs the sort to skip a decimal number n of records before sorting/copying the input file. Records that are skipped are removed before E15 and INCLUDE/OMIT processing begins.

STOPAFT

STOPAFT=n sorts/copies at most n records. These represent the first n records following any input processing from E15, INCLUDE/OMIT, or SKIPREC parameters.

Limitations

Control Card Logic

The SYSIN member uses OUTFIL with OMIT conditions to route records to specific files based on field values. For example:

OUTFIL FILES=02,OMIT=(36,6,PD,EQ,0),OUTREC=(36,74)

This directs non-zero packed-decimal values from position 36-41 to file 02 with a 74-byte record length. This technique efficiently distributes records across multiple datasets in a single pass.