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 will happen if we move SPACES to numeric field and ZEROES to alphabetic field?

2 Answers  


What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program ?

8 Answers   Arigo Infotech, IBM,


what is srange and nosrange pls reply to ths question ?

2 Answers   L&T,


consider the following piece of code 01 GROSS-PAY 05 BASIC-PAY PIC 9(5) 05 ALLOWENCES PIC 9(3) if BASIC-PAY has a value 1000 and ALLOWENCES has a value of 250,what will be displayed by the statement DISPLAY GROSS-PAY a.1250 b.01000250 c.01250 d.1.250

3 Answers   TCS,


Can the OCCURS clause be at the 01 level?

8 Answers   Oracle,






What is normalisation?

2 Answers   IBM,


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

4 Answers   Complex System, Infosys,


What are the pertinent COBOL

0 Answers   IBM,


I got user abend U4038 while compiling my runjcl.. can anyone help me?

10 Answers   CGI,


Whats the use of Examine command? can someone help me?

1 Answers   IBM,


How do you code Cobol to access a parameter that has been defined in JCL?

3 Answers  


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

0 Answers  


Categories