Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


i declare a Table as OCCURS 2000 TIMES.If the input file
has more than 2000 records will the COBOL program fail?

Answers were Sorted based on User's Feedback



i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / giri

No. Program will not fail

Is This Answer Correct ?    14 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / vidhya

If you compile the Program using SSRANGE = Y then the,
program will fail, if not the program will not fail.

Is This Answer Correct ?    14 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / giri

Veena, as far as I knw, An OCCURS clause is used to
indicate the repeated occurrences of items of the same
format in a structure. It is nothing to do with the number
of records in the file. As per your question the filed
which you declare in the table occurs 2000 times. And this
is not the number of record. So your program will read all
the records in the input file. You can display any
occurance of the field like FIELD-NAME(1998) will result in
the value stored in that position, i mean to say 1998th
occurance. When you try to read beyond 2000,the program
will abend with SOC4. I hope I have cleared your doubt!

Is This Answer Correct ?    11 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / cobol will never die

I don't know how one can answer given the lack of
specificity of the question but.... Are we assuming all
records are loaded into the table and no check is made if
the index or subscript is > 2000? In other words are we
loading more than 2000 records data into the program? Can
we also assume this record has numeric definitions?

Given this scenario, and also given the executable code has
no knowledge of a symbolic copybook layout a S0C7 will not
occur as long as the data in the records being loaded is
wholesome. A S0C7 will occur, however, if any of any
numeric data item is corrupted by the overflow, then
referenced by any one of a dozen instructions.

Is This Answer Correct ?    7 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / prem

Occur clause is a kind of an array which holds the data of
simalar type in a particular record.
Ex: If we define an occur clause which hold the marks of a
particular student scored in 3 subjects. The code for this
would be as mentioned below

01 Student.
02 Name PIC X(20).
02 MARK OCCURS 3 times PIC 9(03).

So, For a Student "A" marks would be stored in MARK[1], MARK
[2], MARK[3], for "B" MARK[2], MARK[2], MARK[2] likes wise.

In a record format it would be displayed as below
A___________________052060080

B___________________060068070

Total length of the record is 20 + (3*3) = 29

This code will process n number of records no matter what
is the size of occur clause but if the length of the
records is beyond 29 then only the job will abend.

I hope this answers your query.

Is This Answer Correct ?    5 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / veena

Thanks for the reply ..then will all input file records get
processed or only first 2000 records be processed?

Is This Answer Correct ?    3 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / sivakumar sekharannair

Yeah vidhya's answer is correct. If the complier option is
set with SSRANGE=Y then the program will fail. Other wise
it will not... the default option is NOSSRANGE...

Is This Answer Correct ?    2 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / veena

But when i tested with more than 2000 records it not
abending.all input records are process and written to
output file.Thats why i am confused.

Is This Answer Correct ?    0 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / sadaf rehan

Table OCCURS Clause has nothing to do with the number of
records in the input file..
if you are reading sequentially all the records will get
processed..

Is This Answer Correct ?    0 Yes 0 No

i declare a Table as OCCURS 2000 TIMES.If the input file has more than 2000 records will the COBOL..

Answer / kingmanish

Its in our hands whether we want the program to abend in
case of data overflow or not.
If we specify SSRANGE = Y the program will abend when the
number to records go beyond 2000.

Otherwise for NO SSRANGE the program will not abend.
Though that data will be lost as we cannot reference it.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

Write the code to count the sum of n natural numbers.

0 Answers  


can we use COPY statement in w-s section? how?

3 Answers  


What is SDSF?

3 Answers  


suppose there is one PF having two members PF1 PF2.PF has one unique key Emp ID.could you tell me uniqueness in PF will be effective across members as well ? assume emp iD 3333 is in member PF1 would same Emp id be exist also in member PF2 ?

2 Answers   Tesco HSC, Wipro,


SSRange is used to do a range check on which of the Following. SUBSCRIPT,INDEX,REFERENCE MODIFICATION,Run-time option.

3 Answers   Lehman Brothers,


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

0 Answers   iNautix,


consider the following two IF statements: IF X AND NOT Y MOVE A TO B IF Z=1 OR 9 MOVE A TO B select one of the following data divusion entries which gives identical results for both the above IF statements a.01 Z PIC 9 88 X VALUE 1.9 88 Y VALUE 0.2 THRU 8 b.01 Z PIC 9 88 X VALUE 0.2 THRU 8 Y VALUE 1.9 c.01 Z PIC 9 88 X VALUE 1.9 88 NOT-Y VALUE 0.2 THRU 1.9 d.none of yhe above

3 Answers   TCS,


What is the difference between Call and a Link?

0 Answers  


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 SSRANGE, NOSSRANGE ?

5 Answers  


consider the following two statements MOVE 10 TO N PERFORM PARA-X N TIMES STOP RUN PARA-X MOVE 5 TO N how many times PARA-X willbe exicuted? a.10 b.5 c.infinate d.execution error

6 Answers   ABCL, TCS,


can we use variable picture clause as xx.99 in cobol.

3 Answers  


Categories