![]() Any 02-49 level data definition can contain an OCCURS clause.Īn array can also be specified to consist of group data items: 01 ACCUMULATORS. DAILY-TEMP is not itself an array, but a group data item 72 characters long: 24 x 3. ![]() ![]() This example declares an array named TEMP that contains 24 elementary data items, each of PIC 999, and referenced as TEMP (1), … TEMP (24). ‘int_num’ is any positive integer specifying the number of elements in the array: 01 DAILY-TEMP. To declare an array of elementary data-items, use the clause OCCURS int_num TIMES Arrays may be declared for elementary or group data items at levels 02-49. Each data item in the array is referenced by the name of the array and its position in the array given by a subscript or index contained in parentheses following the array name.Īrrays, as all COBOL data items, must be declared in the DATA DIVISION, but are distinguished from “scalar” (unsubscripted) data items by use of the OCCURS clause in their data definition. a table in WORKING-STORAGE that is searched to obtain a value related to a particular search criteriaĪn array can contain any number of data items of identical type and size.a group of accumulators in WORKING-STORAGE for different categories of totals.a series of similarly formatted input or output record fields in the FILE SECTION.The primary uses of arrays are to define: Arrays are data structures that are used to simplify coding and improve processing efficiency.
0 Comments
Leave a Reply. |