OCCURS (OCC)


The OCCURS command (synonym ARRAY) controls whether array declaration information lines are displayed.

The command is available in the Browse, Edit, and Selection Criteria functions in Formatted mode.

image2021-6-4_9-54-46.png

ON

Displays array declaration information lines. An array definition line is displayed once for each subscripted item in a record layout.

OFF

Does not display array declaration information lines.

Selection Criteria Functionality

ALL

Displays all occurrences separately with the subscript(s) and any criteria entered on a specific occurrence will only be applied to that occurrence.

ANY

Displays a single entry for the occurrences and any criteria entered for the ANY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if any of the occurrences meet the specified criteria. ANY is applied for initial display of a new Selection Criteria set.

Important

When applying 2 or more criteria in the same subset, all have to be true in the same occurrence to be selected.
When entered individually in different subsets, they don’t have to be true in the same occurrence to be selected.

EVERY

Displays a single entry for the occurrences and any criteria entered for the EVERY occurrence will be applied to all occurrences. The record will meet the Selection Criteria if all of the occurrences meet the specified criteria.

Guidelines

  • Use the PROFILE command to display the current ARRAY ON or OFF value. Only ON or OFF are saved in the profile.
  • The array line contains the array name followed by the phrase OCCURS N TIMES. If the item is the subject of an OCCURS...DEPENDING ON clause, the full definition is listed.
  • ANY, EVERY and ALL are available only in Formatted Selection Criteria.
  • ANY, EVERY or ALL is applied per set or subset if any. Each set or subset may have a different array setting.
  • You cannot switch ANY, EVERY or ALL to another if the criteria is specified on any occurrence field in a single set or single subset.
  • In ANY or EVERY mode, the SHOW OFFSET command shows the offsets of the first occurrence.

OCCURS EVERY Selection Criteria

File-AID --- Formatted Selection Criteria -------------------------------------

COMMAND ===>                                                  SCROLL ===> CSR
SET  1 OF  1              INVENTORY-RECORD                     LENGTH:     189
 ---- FIELD NUMBER/NAME ------ -FORMAT- RO ----+----1----+----2----+----3----+-
 18 INV-REORDER-RISK-CODE      1/NUM                                         
 19 INV-NO-OF-VENDORS            1/NUM                                       
 20 INV-VENDOR-INFO(EVERY) OCCURS 1 TO 5 TIMES  DEPENDING ON INV-NO-OF-VENDORS
                                81/GRP                                         
   21 INV-VENDOR-CODE(EVERY)     3/AN                                          
   22 INV-VENDOR-NAME(EVERY)    30/AN                                         
   23 INV-VENDOR-DISCOUNT(EVERY)                                               
                                 3/PS                                         
   24 INV-VENDOR-CONTACT-INFO(EVERY)                                          
                                45/GRP                                        
     25 INV-VENDOR-CONTACT(EVERY)                                              
                                25/AN                                          

     26 INV-VEND-PHONE(EVERY) OCCURS 2 TIMES                                   
                                10/AN                                         
***************************** BOTTOM OF DATA *******************************


 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*