1)what is the maximum limit for occurs?
Eg: 01 A PIC X(10) OCCURS N TIME.
What is the max value for N?
Answers were Sorted based on User's Feedback
Answer / sruthi
HI Prakash,
your ans is wrong.max limit 7 times,that is max number of
dimentions.not the number of occurs.
Is This Answer Correct ? | 21 Yes | 1 No |
Answer / asmara
Hi,
Here u mention it in 01 level so it will give compilation
error and ambiguity occurs so better to give from 02-49
levels will be fine
And where as the max limit for occurs Clause where
OCCURS ON DEPENDING CLAUSE will be 16,711,568 Bytes and the
table size of occurs wont go beyond this limits.
If any update information regarding this, let me inform.
Regards,
Asmara
Is This Answer Correct ? | 13 Yes | 0 No |
Answer / leena_kulkarni
01 level is not used for occurs.
N can go upto 32K (32768 bytes).
Is This Answer Correct ? | 8 Yes | 3 No |
Answer / sivakumar sekharannair
01 level cannot have occurs clasue. Because 01 level is
used for the entire record of a file. entire record length
can not occur again. I.E. Fields in a file can only occur
again.
Is This Answer Correct ? | 3 Yes | 1 No |
Answer / julyo
In Cobol 11 there are a limit of 16,711,568 Bytes and 7 positions of numbers.
For example:
Example 1
05 WTAB-LOTE OCCURS N TIMES
INDEXED BY WIND-LOTE.
10 WTAB-LOTE-REG PIC X(250).
In this case N will be: N=16,711,568/250 , N=66846, and the compiler will accept '99999'
Example 2
05 WTAB-LOTE OCCURS N TIMES
INDEXED BY WIND-LOTE.
10 WTAB-LOTE-REG PIC X(003).
In this case N will be: N=16,711,568/3 , N=55770522, and the compiler will accept '9999999', but this value is less than N and for this second case the limit is related to the number of the positions (7).
But for sure there are the rest of the space in the working section. In the examples was assumed there aren't any other variable in the working.
I hope helped you
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / harish
Hi,
maximum occurs we can use in company is 7 occurs
01 level is not used for occurs clause
N can go upto 16,711,568 i think
Harish poomgame shivappa
NIIT Technolgies
Kolkata
Is This Answer Correct ? | 2 Yes | 3 No |
Answer / sumanth toom
It probably depends on the Cobol version you are using.
I dont think all cobol versions have the same working-
storage space !
Is This Answer Correct ? | 1 Yes | 3 No |
Answer / ravi patnam
Maximum value for the N is 99999999. For example see below:
$set ans85 comp
IDENTIFICATION DIVISION.
PROGRAM-ID. "test".
AUTHOR. RAVI PATNAM.
DATE-WRITTEN. 20-02-2009.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
WORKING-STORAGE SECTION.
01 N pic 9(9) value 0.
01 test-occurs occurs 0 to 99999999
depending on N.
02 test-no pic 9(2).
PROCEDURE DIVISION.
MAIN.
move 99999999 to N.
move 11 to test-no(N).
display test-no(N).
stop run.
Is This Answer Correct ? | 5 Yes | 9 No |
Answer / prakash
01 level is not used for occurs.
MAXIMUM LIMIT IS 7 TIMES IN VS COBOL 11.
MAXIMUM LIMIT IS 3 TIMES IN VS COBOL.
Is This Answer Correct ? | 1 Yes | 10 No |
What are the divisions in a cobol program? Which one is the mandatory division among them?
I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
how to crack cts interview apps? NOVEMBER 21 2010
Can we redefine the field of x(200) to less than 200?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?
Move Zeroes to I move 5 to j perform para1 varying I from 10 by -2 until I = 0 display j. para1. Add 5 to j. What’ll be the value after execution of display stmt. A) 35 B) 40 C) 30 D) 25 please explain how?
i have variable record in the 5th, i want to sort from 5th filed ? how ?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
What care has to be taken to force program to execute above 16 Meg line?
What are the differences bitween cobol and cobol-2?