what is subscript in cobol?give realtime example?

Answers were Sorted based on User's Feedback



what is subscript in cobol?give realtime example?..

Answer / jagan kumar

it is a number of occrances of array data name. subscript is
coded in working-storage section with separate variable.
example.
01 g1.
02 ele pic x(3) occurs 10 times.
01 i pic 99.
procedure division.
perform varying i from 1 by 1 until i > 10
accept ele(i)
display ele(i)
end-perform.
in this is case i is a subscript variable

Is This Answer Correct ?    9 Yes 1 No

what is subscript in cobol?give realtime example?..

Answer / avr

01 g1.
02 ele pic x(3) occurs 10 times.
01 i pic 99.
procedure division.
perform varying i from 1 by 1 until i > 10
accept ele(i)
display ele(i)
end-perform.
in this is case i is a subscript variable

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More COBOL Interview Questions

What COBOL construct is the COBOL II EVALUATE meant to replace?

1 Answers  


)what is retrieve?

1 Answers   IBM,


I encountered an error when I move spaces to a numeric field?What should I do to move spaces on that field?help please.

9 Answers  


how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?

4 Answers   TCS,


01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q + r what will be result of p ans(00) but my question is that how i got 10 on the place of 00. (truncation will ocuure on right side not left). please tell me ?

6 Answers   L&T,


What is the default value of DISP for temp datasets

5 Answers   IBM,


in cobol main pgm is calling sub pgm but sub pgm does not exists , what abend i get if submit the job?

2 Answers   HSBC,


What is the default value(s) for an initialize and what keyword allows for an override of the default?

0 Answers  


how do you reference the rrds file formats from cobol programs

0 Answers  


when COMP-3 is preferrable?

3 Answers   Patni,


Define static linking and dynamic linking.

0 Answers  


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

0 Answers  


Categories