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
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
What is the usage of comp fields in cobol?
Differentiate between structured cobol programming and object-oriented cobol programming.
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
What is the LINKAGE SECTION used in COBOL?
How many sections are there in data division in COBOL?
Explain what you understand by passing by value.
) how do u code after getting data?
In which area will you utilize 88 level items in cobol?
What the difference is between continue and next sentence?
What are the different rules for performing sort operation?
What rules are to be followed while using the corresponding options?
) How do u handle errors in BMS macro
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What is the use of intialize verb?