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 |
01 b pic +9(4) How many bytes it will take for storage???
plz any one tell clearly the justify right clause?
Which mode is used to operate the sequential file?
how do you reference the esds vsam file formats from cobol programs
Sending data is aplhabetic size 7 (value 3000), I wantated this value to be stored in database, which is defined as s9(7)v9(2)comp-3.
can u give result for the fallowing example... 05 a pic 9(2) 05 b redifines a pic x(2). move 'xy' to b. display a,b.
how we rectify soc7 and soc4 errors in project?
what is the difference between Normal vaiable and comp variable.
How do you code Cobol to access a parameter that has been defined in JCL?
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 that the file has 300 records how to acess it?
A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.