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 |
What is the difference between working storage copybook and linkage section copybook?
In an EVALUTE statement is the order of the WHEN clauses significant?
if a>b continue display x. dispaly y. end-if display 1 display 2. display 3. what should be my output ?
What is perform what is varying?
why occurs clause not mentioned in 01 level
6 Answers HCL, NIIT, TCS, Tesco,
what is the basic concept of mainframe? what knowledge is needed for learn this mainframe?
What is the mode in which you will OPEN a file for writing?
wht is load module and object module ?
I have a occurs for 100 times but it has executed 101 time what could be the reason?
Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?
01rec1. 05 a pic 999v99 value 123.12 05 b pic 99v9 value 45.9 02 rec2. 05 x pic 999v99 05 y pic 99v99 05 z pic x(3) value 'abc' if rec1 is moved to rec2 then what is the value of rec2?
What rules are to be followed while using the corresponding options?