Skip Specification

The skip specification specifies a group of records to be processed. The skip is relative to the current record number:

  • The current record number is 1 if this is the first skip specification for this input file in the command and there are no preceding record range list specifications for this input file in the command.

  • Otherwise, the current record number is the record number plus one of the last record of the preceding skip specification or record range list.

<skip specification>

── SKIP ─┬─ + ─┬─<count>─┬──────────────────────────┬──────────────────┤
         └─ - ─┘         ├───────────┬─<count>──────┤
                         ├─ INCLUDE ─┘              │
                         └─ THRU ─┬─<record number>─┤
                                  └─ END ───────────┘

Explanation

SKIP + <count>

Causes the file to be repositioned forward the number of records specified for the count variable. The range begins at the record whose record number is equal to the current record number plus the count value and ends at the end of the file.

SKIP - <count>

Causes the file to be repositioned backward the number of records specified for the count variable. The range begins with the record whose record number is equal to the current record number minus the count value and ends at the beginning of the file.

SKIP + <count> <count>

SKIP - <count> <count>

SKIP + <count> INCLUDE <count>

SKIP - <count> INCLUDE <count>

Cause the range to begin at the record whose record number is equal to the current record number plus the count value or to the current record number minus the count value and to include the number of records specified by the second count value.

The keyword INCLUDE is optional.

SKIP + <count> THRU <record number>

SKIP - <count> THRU <record number>

Cause the range to begin at the record whose record number is equal to the current record number plus the count value or equal to the current record number minus the count value and to end at the record specified by the record number.

SKIP + <count> THRU END

SKIP - <count> THRU END

Cause the range to include all the records from the record whose record number is equal to the current record number plus the count value or equal to the current record number minus the count value through the end of the file.

Examples

All the examples that follow assume that the preceding record range list consisted of records 5 through 10, so that the current record number is 11.

Example 1

Example 1 skips three records from the current record number and includes the three records following the skip. The new range includes records 14 through 16, inclusive.

SKIP + 3 3

Example 2

Example 2 skips two records from the current record number. The new range includes records 13 through 18, inclusive.

SKIP + 2 THRU 18

Example 3

Example 3 skips backward 3 records from the current record number. The new range begins with record 8 and ends at the end of the file.

SKIP - 3

Considerations for Use

You can use a list that contains a mixture of record range lists and skip specifications. However, after you specify END in either one, you cannot specify any other record range lists or skip specifications.