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 external and global variables in COBOL?
What is difference between static and dynamic call in cobol?
Explain the configuration section of a cobol program with examples of syntax.
what is difference between cobol and cobol/400
What are the different rules to perform a Search?
How to print 10 to 1 if the input have only 10 digit number?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What is report-item in COBOL?
What are the different types of condition in cobol and write their forms.
What is the use of intialize verb?
) How do u handle errors in BMS macro?
How many sections are there in data division in COBOL?
What is the utilization of copybook in cobol? Could we utilize a similar copybook?
What type of SDLC u followed? Why?
What is the difference between perform … with test after and perform … with test before?