Difference between subscript and index, difference between search and search all

       
Subscript
index
       1.      It is occurs of the table.
       2.      Occurs converters in term of displacement and fetch the values.
      3.      We have declared in working storage section.
      4.      To modify subscript values by using arithmetic operations or for display.                                            5.      It is slow performing.
1. It is displacement of the table.
2. Displacement refers to address and fetch the values.
3. There is no declared in working storage section.
4. To modify index values with set, search, search all & perform statement.
5. It is faster performing.

Search
Search all
1.   Sequential search.

2.   Table need not be sort order.

3.   Multiple when conditions can be coded.

4.   Any logical comparison is possible.


5.   Set verb is need.

6.   Applied to large of tables.

7.   Access is slow.

8.   Syntax:
SET index name to 1
SEARCH identifier
    AT END display
    WHEN condition-1
     WHEN condition-2
     DISPAY
END-SEARCH
1.   Binary search.

2.   Table must be in sorted order.

3.   Single when conditions can be coded.

4.   Only = is possible, only AND is possible compound conditions.

5.   No need of set verb.

6.   Applied to small size of tables.

7.   Access is faster.

8.   Syntax:
SEARCH ALL identifier
          AT END
                 DISPLAY
          WHEN condition-1
                 DISPLAY
END-SEARCH

Comments

Popular posts from this blog

COBOL + DB2 complication process.

ABEND list for JCL

difference between jes2 and jes3