i declare a Table as OCCURS 2000 TIMES.If the input file
has more than 2000 records will the COBOL program fail?
Answer Posted / 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 |
Post New Answer View All Answers
What is the difference between PIC 9.99 and 9v99 in COBOL?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
What guidelines should be followed to write a structured cobol prgm?
What is the use of intialize verb?
can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech
I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
Can we redefine the field of x(200) to less than 200?
What is an in line perform? When would you use it? Anything else you wish to say about it.
What is the LINKAGE SECTION used in COBOL?
What type of SDLC u followed? Why?
What is comp-1 and comp-2?
Explain about different table spaces.
What is rmode(24)
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that