EVERY keyword

The EVERY keyword lets you select every Nth occurrence of a segment starting from the first segment.

For DDEP segments, every Nth occurrence of a segment under a parent, and for root segments, every Nth occurrence of a root segment in a synonym chain under a RAP. If the SKIP keyword is specified, the first segment is the next segment after the skipped number of segments. For SDEP segments, this keyword is only valid with SDEPHIER=NO, and the keyword lets you select every Nth segment starting from the first CI of the SDEP part.

EVERY is an optional keyword for the OUTPUT statement of ODE. If this keyword is specified, it must be assigned a value.

Format:
Read syntax diagramSkip visual syntax diagramEVERY= value
value
Select segments at the indicated interval. The value you specify must be in the range of 1 - 9999999.
Default:
None.
Site default support:
Not supported.
Restrictions:
  • This keyword must be preceded by a valid OUTPUT SEG= specification.
  • Dependents of parents bypassed due to EVERY are not selected.
  • You cannot have multiple values for the EVERY keyword specified for the same segment name. If you do specify multiple values, only the last valid occurrence of the EVERY keyword will be in effect.
  • If more than one of the STOPAFT, SKIP, or EVERY keywords is specified, SKIP is applied first, then EVERY, and then STOPAFT.
  • SELECT statement criteria are evaluated before EVERY. Only matched segments are counted. Counts are maintained for segment occurrences under a single parent and are reset when parentage changes.
  • If DEPENDENTS is specified in the preceding SEG keyword, the EVERY keyword cannot be specified.

The start position of the selected segment occurrence is determined by the value of the SKIP keyword.

For example (there are 10 segment occurrences)

   OUTPUT SEG=seg_name,EVERY=2,SKIP=1,STOPAFT=3
  1. The first segment is skipped by SKIP=1.
  2. The second, fourth, and sixth segments are included in the output by EVERY=2.
  3. The eighth and tenth segments are not included in the output by STOPAFT=3.

In the following example, the start position is decided by starting from the first segment. For example, (There are 10 segment occurrences)

   OUTPUT SEG=seg_name,EVERY=2,STOPAFT=3
  1. The first, third, and fifth segments are included in the output by EVERY=2.
  2. The seventh and ninth segments are not included in the output by STOPAFT=3.