1)what is the maximum limit for occurs?

Eg: 01 A PIC X(10) OCCURS N TIME.

What is the max value for N?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are INPUT PROCEDURE and OUTPUT PROCEDURE?

679


How to know whether the module is dynamical or statistical?

650


i want a program using by if, evaluate , string, unstring, perform, occurs?

4043


What are the different open modes available in cobol?

713


What is the difference between comp and comp-3 usage?

672






How to remove 2 duplicate records and copy only one using job control language?

735


how can i see junk values in dclgen or in hostvariable of comp ?

2538


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

637


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

639


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 ......

10571


Explain about different table spaces.

642


Can a Search can be done on a table with or without Index?

800


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

731


How do you define a variable of comp-1 and comp-2?

699


In which area will you utilize 88 level items in cobol?

711