What is the difference between a subscript and an index in
a table definition?

Answers were Sorted based on User's Feedback



What is the difference between a subscript and an index in a table definition?..

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

What is the difference between a subscript and an index in a table definition?..

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

What is the difference between a subscript and an index in a table definition?..

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

Post New Answer

More COBOL Interview Questions

how can we get current dat and time thru cobol pgm

3 Answers   DELL,


how to transfer the file from pc to mainframe??

5 Answers   TCS,


How to read the last 100 records from a COBOL file. The file contains N number of records.

11 Answers   IBM,


When would you use in-line perform?

2 Answers  


I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?

5 Answers   RBS,






How many bytes S(8) comp field occupy and its maximum value?

0 Answers  


What is static and dynamic call in cobol?

0 Answers  


How do u debug a S0C7 abend? (aswered till we get the field which caused that) After knowing the field which caused that how do u know the record which caused that if it is in production env? (dumb) Ok let us assume that we got to know that 100th record caused that and I wanted to skip only 100th record from the file and process from 101th. How to do that in JCL using SORT? (tried with STOPAFT but ended up dumb when he said smthing else is ther)

3 Answers   IBM,


We have 3 programms A,B,C.In the middle of the program A the controls goes to program B and in the middle of the program B control wants to go program C,after completion of program C again control comes to program B and again after completion of program B control comes to program A.How the process will takes and what are the controls we use for that process.If it is possible anybody of you explain with example?

5 Answers   IBM,


what is the size of W-REC in the following 01 W-REC 05 A PIC 9(4)V99 05 B READLINES A 10 C PIC XX 10 D PIC S9(4) 05 E OCCURS 7 PIC ZZ.ZZ 05 F OCCURS 5 10 G PIC ZZ.ZZZ99 10 H OCCURS 3 15 J PIC 9(3) 15 K PIC V99

2 Answers   TCS,


what is the difference between COBOL2 AND COBOL390?

0 Answers   L&T,


in cobol perform stmt whether it first checks the condition or not

9 Answers  


Categories