how can we code index in an array of cobol pgm?



how can we code index in an array of cobol pgm?..

Answer / jenny

It can be done in two ways:

1.Using the INDEXED BY phrase on the OCCURS clause.

2.index can be defined(as a working storage variable) with
USAGE IS INDEX clause.

In either case the index is set, icreased or decreased
using the SET verb in the Procedure Division.

Is This Answer Correct ?    15 Yes 2 No

Post New Answer

More COBOL Interview Questions

I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.

3 Answers  


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

0 Answers  


what are the paramater we cannot use in procedure?how many instream we can write in single jcl?can we call instream to catalog and ctalog to instream?

2 Answers   Satyam,


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

0 Answers   IBM,


when SE37 SB37 and sd37 occurs how to increase the volume , primary quantity and secondary quantity?

1 Answers   Hewitt,






How is sign stored in Packed Decimal fields and Zoned Decimal fields?

6 Answers   ABC, HCL, TCS,


if you give cylinder(1,1)how many cylinders it will be allocate?

3 Answers   Hewitt,


How to solve SOC7. I have the cobol coded as below 01 A PIC 9(4). 01 AIN REDEFINES A. 05 AIN1 PIC S9(4) 01 B PIC 9(4)V99. 01 BIN REDEFINES B. 05 BIN1 PIC S9(4)V99. PROCEDURE DIVISION. START-PARA. INITIALIZE A AIN B BIN. ACCEPT A B. DISPLAY 'VALUE OF A=' A. DISPLAY 'VALUE OF B=' B. DISPLAY 'VALUE OF BIN1=' BIN1. DISPLAY 'VALUE OF AIN1=' AIN1. COMPUTE AIN1 = BIN1 - AIN1. DISPLAY 'VALUE OF AIN1=' AIN1. When i'm executing this code i'm getting SOC7 for A = 12 & B=34. Can someone explain SDSF OUTPUT DISPLAY TCOM058R JOB05458 DSID 102 LINE 0 COLUMNS 02- 81 COMMAND INPUT ===> SCROLL ===> CSR ********************************* TOP OF DATA ********************************** VALUE OF A=12 VALUE OF B=34 VALUE OF BIN1=34 VALUE OF AIN1=12 CEE3207S The system detected a data exception (System Completion Code=0C7). From compile unit PROG1 at entry point PROG1 at statement 29 at compile +000004CE at address 00007ECE. Please address how to solve this issue Thanks in advance.

1 Answers  


what are the control characters used in reports

1 Answers  


What is the difference between copy and include in cobol?

1 Answers  


What is the maximum length of a field you can define using COMP-3?

4 Answers   Complex System, Infosys,


Consider the following: 77 W-NUM PIC 9 VALUE 0 ------ MOVE 1 TO W-NUM PERFORM PARA-X UNTIL W-NUM > 9. ------ PARA-X ADD 1 TO W-NUM How many times PARA-X is executed ?

14 Answers   Accenture, TCS,


Categories