Can we access the a[0] in the array ?

Answers were Sorted based on User's Feedback



Can we access the a[0] in the array ?..

Answer / mandozai

In cobol array starts with 1 not with 0

Is This Answer Correct ?    20 Yes 0 No

Can we access the a[0] in the array ?..

Answer / sandy

Not possible. It will throw compilation error.

Is This Answer Correct ?    8 Yes 2 No

Can we access the a[0] in the array ?..

Answer / jai ho

i think it will send soc4 abend bcoz a[0]
is out of bound.

Correct me

Is This Answer Correct ?    4 Yes 0 No

Can we access the a[0] in the array ?..

Answer / suresh ramaiyan

It will give compilation time error, as the compiler knows
the value of subscript when compile the program.
ex: A[0]

if you are accessing the same by subscript variable, then
it will give run time error.
ex: A[ws-cnt]

Is This Answer Correct ?    3 Yes 0 No

Can we access the a[0] in the array ?..

Answer / i go crazy

The compilation should be done with the compiler option SSRANGE. If NOSSRANGE is used, then we can use A(0) without any issue.

Is This Answer Correct ?    3 Yes 0 No

Can we access the a[0] in the array ?..

Answer / dev

Can u explain why it throws compilation error?

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More COBOL Interview Questions

what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


ID DIVISION. PROGRAM-ID. PLO. DATA DIVISION. WORKING-STORAGE SECTION. 01 VAR1 PIC 9(2). 01 VAR2 PIC X(2). PROCEDURE DIVISION. ACCEPT VAR2. MOVE VAR2 TO VAR1. STOP RUN. if i give 'PI' in var2 then what will b output of progr. any abend?????

6 Answers   TCS,


What happens when we move a comp-3 field to an edited (say z (9). Zz-)?

0 Answers  


what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  






How to resolve the soc4 and soc7 errors?

5 Answers   IBM, RBS,


What does the initialize statement do ?

2 Answers  


what is filler and what is use of filler

3 Answers   Syntel,


i have a file which contains records like 10,30,90,50,20,40,80,60,70 i want to display these records in reverse order like 70,60,80,40,20,50,90,30,10 please give me the cobol code (do not sort the records)

3 Answers   Cap Gemini, Mind Tree,


Which of the following paragraphs is compulsory in every COBOL program? (a) SPECIAL-NAMES (b) PROGRAM-ID (c) FILE-CONTROL (d) OBJECT-COMPUTER

4 Answers  


plz any one tell clearly the justify right clause?

1 Answers  


what is soc7 abend?how u can trace it?

4 Answers   Accenture,


Categories