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 |
which is better comp or comp-3 in terms of memory utilization?
What is COMP SYNC?
have in 100 records in a flat file i want to move records like 1,3,5,7,9,11,.. to Output file1 and 2,4,6,8,10,12,14 .. records moved to Output file2..Pls Provide real time answer..
01 A pic 9(100) find record length of it
Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya
What are the different forms of EVALUATE statement?
1)what is the maximum limit for occurs? Eg: 01 A PIC X(10) OCCURS N TIME. What is the max value for N?
) how do u code after getting data?
WHY LRECL NEEDS TO BE 4 EXTRA THEN THE COBOL FILE LENGTH & WHAT IT CONTAIN IN THAT LENGTH
can internal sort be applied to sort ksds files?
how to display date in reverse order if the pic clause of the is numeric suppose date is 09032010 ==> need to print in 20100309 (pic clause is numeric)
how to submit a jcl by cobol program. clear me with an example.