DFSORT OUTREC Inserting sequence numbers

DFSORT OUTREC: Reformatting with FINDREP DFSORT OUTREC: Inserting sequence numbers

Advertisements


IFTHEN clauses for the OUTREC statement can be used to select subsets of the output records and apply different BUILD, FINDREP or OVERLAY items to them.

Five types of IFTHEN clauses as follows:


WHEN=INIT:

Use one or more WHEN=INIT clauses to apply BUILD, FINDREP or OVERLAY itemsto all input records.

WHEN=INIT clauseis processed before any of the other IFTHEN clauses.


WHEN=GROUP:

Use one or more WHEN=GROUP clauses to spread fields, identifiers and sequence numbers within groups of records.

The records can define that belong to a group using an suitable combination of BEGIN=(logexp), END=(logexp), KEYBEGIN=(field) and RECORDS=n parameters.

A KEYBEGIN=(field) parameter is satisfied when the field value changes.

WHEN=GROUP clauseis processed before any of the other IFTHEN clauses.


WHEN=(logexp):

Use one or more WHEN=(logexp) clauses to apply BUILD, FINDREP or OVERLAY items to the subset of records that satisfy a specified logical expression.


WHEN=ANY:

Use a WHEN=ANY clause after multiple WHEN=(logexp) clauses to apply additional BUILD, FINDREP or OVERLAY items to records if they satisfied the criteria for any of the preceding WHEN=(logexp) clauses.


WHEN=NONE:

Use one or more WHEN=NONE clauses to apply BUILD, FINDREP or OVERLAY items to records that did not meet the criteria for any of the WHEN=(logexp) clauses.

WHEN=NONE clauses are processed after any of the other IFTHEN clauses.


Example: - Will update soon


DFSORT OUTREC: Reformatting with FINDREP DFSORT OUTREC: Inserting sequence numbers

Advertisements