Can anybody give me example of subscript and index
Answers were Sorted based on User's Feedback
Answer / billyboyo
In IBM Cobol there are two methods of accessing elements in
a table (array). By subscript, which you explicitly define
in the Data Division or by index, which is implicitly
defined by the compiler.
01 subscript-for-table COMP PIC S9(4).
If you want the 20th item, set the above to 20 and use
field-looked-for (subscript-for-table).
An index is the displacement of an item from the start of a
table. For a subscript, the displacement, which is needed
to find the item, is calculated at run time (from the
subscript and the length of the data item(s)). So an index
is faster, but is generally considered more complex to use.
Some features, like SEARCH ALL, require the use of an INDEX.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / arya
number of occurences are called subscript.............
number of dispositional position are called index...........
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / krishna
Subscript means occuresses, it can declared in WS-section
index means displacement,need not be declared
| Is This Answer Correct ? | 1 Yes | 5 No |
Answer / pandu
Subscript is sequential reading Index is direct reading of
perticular position of record
| Is This Answer Correct ? | 0 Yes | 5 No |
Answer / mahii
index is no of occurance we can find data exactly
subscript is displacement mainli its is used in arrays to
load the data
| Is This Answer Correct ? | 1 Yes | 9 No |
How do pass the values to the parameters in cobol
how do you move only numeric data from A to B 01 A pic x(10) value 'a1b2c34d5e'. 01 B pic x(5).
How to know whether the module is dynamical or statistical?
Determine the total no of bytes in the following. 01 rec1. 02 a pic x(6) 02 b redefines a. 03 c occus 6 times pic 9. 02 d occurs 6 times pic 9. 03 e pic x(5) 03 f pic 999.
I have a cobol program with a sub program. How ca i find that it is a dynamic call? or static call..?
what is the coding difference between COBOL and CICS.
comp-3 field occupy?
Q:what is the difference between the variable length and fixed lenght.how it varies in the cobol.
Why we need to use redefine clause when we can define the variable seperately... what is actual need....
What is link edit in cobol?
01 var1 pic x(10) 01 var2 redefines var1 pic 9(10). then in procedure division move 'abcde' to var1 then waht is the value of var1 and var2
Which mode is used to operate the sequential file?