You are here: Job and Form Set Rules Reference > JDT Rules Reference > SortBatches

SortBatches

Use this job level rule to sort RCB batches before they are printed. This rule provides a way for you to call an external sort program to rearrange the order of the recipient batch files (RCB files).

     
Note The SortBatches rule is not available for z/OS implementations.

Syntax

;SortBatches;;;

The SortBatches rule provides two ways to sort batches:

This is the default sort for running under Windows. This sort command uses the Windows command line sort and builds an RCB file with a prepended sort key. Use this method if the external sort program uses a single sort field.

Use this method when you need to create a sort command with a repeating pattern for each sort field.

     
Note Sorting with multiple keys is not available for the Windows platform.

Depending on the size of the recipient batch file, performance can be affected. The larger the input file, the slower the performance.

The SortBatches rule performs the required initial logic before the main job execution and executes the external sort program after execution. Place this rule immediately before the JobInit1 rule in your AFGJOB.JDT file, as shown here:

;RULStandardJobProc;;Always the first job level rule;

;SetErrHdr;;***:------------------------------------------------;

...

;SortBatches;;;

;JobInit1;;;