Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time storage usage of OCCURS DEPENDING ON

Status
Not open for further replies.

SPRHX

Programmer
May 5, 2003
1
US
COBOL Gurus,

Hi. I was interested in the reality of OCCURS DEPENDING ON at run-time (for working storage variables). Is the amount of storage used actually variable (i.e. dynamic storage changes as ODO object changes) and is the run-time behaviour specified in the COBOL85 standards (or is it vendor specific)?

If it is dynamically varied at run-time, are there any performance or other storage implications (I guess that it may be in 4KB page-size blocks or something).

I'm using IBM COBOL for OS/390. The manuals aren't clear about the run-time behaviour.

Many thanks in advance,

Stuart R (SPRHX)


 
No,

I think it sets up a min and max size for the ODO variable and allocates storage for the max. I don't believe that COBOL has had truly variable-sized variables as C and other languages.

But, it may depend on platform. PC-based COBOL may be different.

Tom.
 
Hi Stu,

The compiler allocates the max size for the table. The ODO object (or is it subject?) inhibits table use beyond the point at which it is set at any point in time.

But, if you move (or whatever) the table the operation will be variable in length.

HTH, Jack.
 
In some environments like IBM mainframe and PC it is possible to allocate storage at runtime with a call to some runtime environment.

You can define the table in the linkage section and use a pointer to link it to the storage you allocate with a call to the language environment.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top