What is the difference between a subscript and an index in
a table definition?
Answers were Sorted based on User's Feedback
Answer / mftech
Subscript is the occurance number in the arrary of element.
Fr e.g., an array has only one itme that repeats for 20
times, in order to refer to 10th itme in this array, you
can say ITEM(20). This '20' can be replaced by a WS
variable having value = 20.
Index: It is the displacement from the begining. if you
remember, when we use Index in a loop, then we do not code
Move 2 to WS-INDEX. We have to code. We need to set the
index to zero and then increament.
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / satheesh gova
subscript specifies the no of occurances of a table or
array where as index specifies the displacement of a
table,subscript is working storage variable but index is not
working storage section variable,by using arithematic
operations we can increment and decrement the value of
subscript,but by using SET verb we can get it in index.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / srinu
Subscript is the occurance number in the arrary of element.
Fr e.g., an array has only one itme that repeats for 20
times, in order to refer to 10th itme in this array, you
can say ITEM(20). This '20' can be replaced by a WS
variable having value = 20.
Index: It is the displacement from the begining. if you
remember, when we use Index in a loop, then we do not code
Move 2 to WS-INDEX. We have to code. We need to set the
index to zero and then increament.
| Is This Answer Correct ? | 2 Yes | 0 No |
Hi , I am posting some questons which are asked at interview. These may help u for ur interview... what is static and dynamic call?
What is the difference between copy and include in cobol?
How may divisions are there in JCL-COBOL?
When can the USING phrase be included in the call statement ?
how do you define single dimensional array and multidimensional array in your cobol?
In the JCL, how do you define the files referred to in a subroutine ?
we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?
Which mode is used to operate the sequential file?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
What is a subscript ?
what happens if we dont close cursor in db2-cobol pgm?
What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program ?
8 Answers Arigo Infotech, IBM,