This portal is to open public enhancement requests against IBM Z Software products. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).
We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:
Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,
Post an idea.
Get feedback from the IBM team and other customers to refine your idea.
Follow the idea through the IBM Ideas process.
Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.
IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.
ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.
See this idea on ideas.ibm.com
Enterprise Cobol V6 compiler brings the ALLOCATE and FREE statements for managing the memory associated with a structure defined in the LINKAGE SECTION.
These statements are not directly applicable to an UNBOUNDED table but can allocate and free memory through a pointer variable and an arithmetic expression, and the address of the UNBOUDED table can be fixed by this pointer variable :
- ALLOCATE numeric-expression CHARACTERS RETURNING pointer-variable
- SET ADDRESS OF unbounded-table TO pointer-variable
However, it lacks a statement to resize the previously allocated area to respond to an expansion or a reduction of the table without loss of data already stored in the UNBOUDED table.
It remains possible to allocate a new memory area by ALLOCATE, MOVE the structure of the unbounded table to this new area, and then release the previously allocated memory area by FREE, but this more complex treatments than a RESIZE.
Before Cobol V6, we use the Language Environment functions to manage dynamically allocated memory:
-CEEGTST: comparable to the ALLOCATE Cobol V6 statement
-CEEFRST: comparable to the FREE Cobol V6 statement
-CEECZST: no equivalent Cobol V6 statement
Note that CEECZST can change the address of the allocated memory area and it is then necessary to reattach the address of the structure in the LINKAGE SECTION.
It would be useful to have a Cobol statement to change the size (grow or shrink) of an already allocated memory area, with an option to keep the already loaded data.
For example:
RESIZE pointer-variable FOR numeric-expression CHARACTERS [NO] PRESERVE
Idea priority | Medium |
By clicking the "Post Comment" or "Submit Idea" button, you are agreeing to the IBM Ideas Portal Terms of Use.
Do not place IBM confidential, company confidential, or personal information into any field.
This has been added to V6.x:
The example has been added in the Language Reference (see Procedure Division -> ALLOCATE statement -> Example: ALLOCATE and FREE storage for UNBOUNDED tables
I continue to not understand why you are now using "not standard" as a reason to not do something. There are plenty of "not standard" features within Enterprise COBOL, obviously there because customers requested them. If the standard is deficient (as it is in this case), shouldn't the requirement be implemented nonetheless?
This is a good idea, but is not part of the COBOL Standard. As a result, we will use this RFE to update our documentation to provide an example of how to do this with current compiler syntax.