What is the difference between subscript and index?

Answer Posted / robertd903

Subscripts are programmer-defined variables, of numeric type--used to reference an array.
Example:
77 WS-SUB PIC 9(04) COMP.
01 WS-TABLE.
05 WS-TABLE-ENTRY OCCURS 5 Times PIC X(80).

In PROCEDURE DIVISION:
MOVE WS-TABLE-ENTRY(WS-SUB) TO...

Indexes are defined by the programmer, but the PICTURE clause is omitted.
Example:
01 WS-TABLE.
05 WS-TABLE-ENTRY OCCURS 5 TIMES INDEXED BY WS-IDX.
10 FILLER PIC X(80).

In PROCEDURE DIVISION:
MOVE WS-TABLE-ENTRY(WS-IDX) TO...

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write down the divisions of cobol program?

665


Can you please let me know the centre name of INS certification in Kolkata.

1713


how to convert the recors form vsam file to db2 table tru file aid

2757


What is the difference between comp and comp-3?

692


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

6805






Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

817


I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

1798


how do you define single dimensional array and multidimensional array in your cobol?

667


In which area will you utilize 88 level items in cobol?

712


Give some examples of command terminators?

751


EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?

2052


1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?

5370


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

1607


how can i see junk values in dclgen or in hostvariable of comp ?

2538


What guidelines should be followed to write a structured cobol prgm?

666