SORT INCLUDE and OMIT Statements | JCL INCLUDE | JCL OMIT Example.

Topictrick.com
2 min readDec 9, 2020

--

In today’s tutorial, I will discuss SORT INCLUDE and OMIT control statement. These are very important control statements that are used to improve the efficiency of a SORT job. So, let’s start with our tutorial.

What is JCL INCLUDE and OMIT Statements?

Every day millions of jobs run on the mainframe to SORT or MERGE data from different files. These jobs use various control statements as per requirements. INCLUDE and OMIT are two such parameters that are used to improve SORT efficiency and these parameters provide some more processing capabilities.

The SORT INCLUDE and SORT OMIT statements is used to identify the records that should be included or omitted from the sort or merge process.

The syntax of the INCLUDE and OMIT statements

INCLUDE COND=(field,comparison,{field }, [ {AND}, ]…)
{constant} {OR }
OMIT COND=(field,comparison,{field }, [ {AND}, ]…)
{constant} {OR }

  • field:: A field to be used in a comparison. The field is specified as in the SORT or MERGE statement: position, length, format.
  • comparison:: One of these comparison operators:

EQ :- Equal GEGreater than or equal to

NE :- Not equalLTLess than

GT :- Greater thanLELess than or equal to

Decimal 5 +104 -39

Character C’CA’ C’JONES’ C’X24'

Hexadecimal X’00' X’F9F9' X’40404040'

INCLUDE Example: Include only the records that have an A in byte 1.

//RCTX021D JOB (JOB CARD…..)

//SORTIN DD DSN=RC01.PAYROL.FILE,DISP=SHR

Include and Omit Examples.

Example 1: INCLUDE only the records with a packed-decimal value in bytes 72–76 that’s greater than or equal to 1000.

Example 3: OMIT the records that have an A in byte 1.

Originally published at https://mainframe-forum.blogspot.com.

--

--

Topictrick.com
Topictrick.com

Written by Topictrick.com

Topictrick is a comprehensive repository of programming language tutorial and tech reviews. Also, it showcases what new in the tech industry. One place for all.

No responses yet