1) can we display the index?

Answers were Sorted based on User's Feedback



1) can we display the index?..

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

1) can we display the index?..

Answer / jswan

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

1) can we display the index?..

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

Post New Answer

More COBOL Interview Questions

Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

0 Answers  


what is the meaning of pic 9(09)v99-

4 Answers   HSBC,


Name some of the examples of COBOl 11?

0 Answers   CSC,


if a=b how the flow will complete??? perform test through test-exit. perform activa through activa-exit. test. if a=b then next sentence else move a to c. test-exit. exit. activa. -- -- activa-exit. exit.

1 Answers   IBM,


What is an in-line perform ?

4 Answers   Accenture,






What is the maximum data length for Numeric DataType ?

3 Answers   Cap Gemini,


Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


What is the difference between write & move in COBOL?

3 Answers   CSC, HHB,


Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ? Thanks krishna chaitanya

2 Answers   CSC,


what is the purpose of linkage section?

10 Answers  


How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length

3 Answers   TCS,


What is the difference between performing a SECTION and a PARAGRAPH?

5 Answers   Accenture, Patni,


Categories