1) can we display the index?
Answers were Sorted based on User's Feedback
Answer / shan
Ya correct,
To be more clear,
Declare a variable with usage is index (01 WS--VAR-DISPLAY
USAGE IS INDEX)
then SET WS-VAR-DISPLAY to WS-INDEX
Display WS-VAR-DISPLAY
| Is This Answer Correct ? | 12 Yes | 7 No |
You can't directly display the Index. But you can create a normal numeric field in your working storage and set that to the Index.
Example:
01 WS-TABLE.
05 WS-CUSTOMER PIC X(25) OCCURS 10 INDEXED BY INDEX1.
01 WS-NUMERICS.
05 WS-INDEX-COUNT PIC 9(02) VALUE 0.
SET WS-INDEX-COUNT TO INDEX1.
DISPLAY WS-INDEX-COUNT.
| Is This Answer Correct ? | 2 Yes | 1 No |
Answer / naina
Yes, we can!!!
The easiest way, which would work in all versions of COBOL
is
SET W-S-VAR-PICS9(9)-USAGE-DISPLAY TO THE-INDEX-U-WANT-TO-
DISPLAY
DISPLAY W-S-VAR-PICS9(9)-USAGE-DISPLAY
| Is This Answer Correct ? | 4 Yes | 5 No |
WHAT IS SOC3?HOW IT CAN BE RESOLVED?
how to pass 100 to s9(4) how r they inserted ?
Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
what is the use of outrecord?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
Write a program to explain size error.
Why IBM?
what is the use of filler in cobol programing?
subscript and index r not coded in u r application program what will happen?
how will u code parm parameter and where pls ?
How do u write test cases?