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
Why did you choose to work with ibm mainframe cobol programming?
What are the different open modes available in cobol?
Differentiate between structured cobol programming and object-oriented cobol programming.
How can we find that module can be called – whether DYNAMICALLY or STATICALLY?
What do you understand by psb and acb?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
How do you get the data to code the BMS macro?
How do you define a variable of comp-1 and comp-2?
How do you differentiate between cobol and cobol-ii?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Write down the divisions of cobol program?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
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?
) what is the difference between AID and HANDLE AID?
input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.