1. difference b/w index and subscript is
Index is defined in occurs clause i.e for example,
02 LETTER REDEFINES TABLEVAL.
03 LETVAL PIC X OCCURS 26 TIMES INDEXED BY LTIDX.
add 1 to LTIDX. ===> cannot be done. yields to error
so here, LETVAL array can only be accesed by LTIDX
ie LETVAL(LTIDX). you cannot use any other integer variable.
LTIDX is called the index. and it initialized using SET verb. also we cannot use index variable for any arithmatic operation.
Subscript is a normal variable used for accessing the array.
77 i pic 9.
77 a pic x occurs 26 times.
add 1 to i. ===> can be done
so here, I is the subscript, here u can use that variable 'i' for any function, ie we can increment, decrement etc.
Index variables access the array element using the displacement (memory address), while subscript access the array using occurance number (position). Indixes are more faster and can be used to search the table.
2) what r diff. types of divisions. I saw in a book that thr
are 6 division. i know only 4 div. id div,en div,data div,proc div
what are all the other two div.
There are 4 divisions only in COBOL. I beleive, you misunderstand with the 6 sections in data division.
3) whatz the use of filler clause?
Used to initialize an undeclared element.
Used to reserve memory for future use
Used to declare constants
Used to save memory area
Used to initialize a table