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
Hi,
As part of the creation of a COBOL framework to speed up developments, we are looking for a solution to fix the size of an elementary data-item at the time of compilation because it cannot be determined at the time of writing the code.
Sample use case:
*> from ZCOMMON COPYBOOK
01 ZCOMMON.
05 ZCOMMON-HEADER.
10 ZCOMMON-KEY1 PIC X(10).
10 ZCOMMON-KEY2 PIC X(5).
05 ZCOMMON-DATA.
10 ZCOMMON-ITEMS PIC X(max length of ZREC*-ITEMS).
*> from ZREC01 COPYBOOK
01 ZREC01 REDEFINES ZCOMMON.
05 ZREC01-HEADER.
ZREC01-KEYS PIC X(length of ZCOMMON-HEADER).
05 ZREC01-DATA.
10 ZREC01-ITEMS.
15 ZREC01-ITEM1 PIC X(5).
15 ZREC01-ITEM2 PIC X(3).
10 ZREC01-COMPL PIC X(length of ZCOMMON-ITEMS - length of ZREC01-ITEMS).
*> from ZREC02 COPYBOOK
01 ZREC02 REDEFINES ZCOMMON.
05 ZREC02-HEADER.
ZREC02-KEYS PIC X(length of ZCOMMON-HEADER).
05 ZREC02-DATA.
10 ZREC02-ITEMS.
15 ZREC02-ITEM1 PIC X(30).
10 ZREC01-COMPL PIC X(length of ZCOMMON-ITEMS - length of ZREC02-ITEMS).
At compile time:
length of ZCOMMON-HEADER = 15
length of ZREC01-ITEMS = 8
length of ZREC02-ITEMS = 30
length of ZCOMMON-ITEM = max(8,30) = 30
length of ZREC01-COMPL = 30 - 8 = 22
length of ZREC02-COMPL = 30 - 30 = 0
It should be noted that the determination of a value may be dependent on another value that is defined downstream in the source code flow, and that some calculations may provide a value 0 (possibly negative) and in this case the elementary data-item should have a size of 0, and should not be considered as an error.
The result obtained would therefore be:
*> from ZCOMMON COPYBOOK
01 ZCOMMON.
05 ZCOMMON-HEADER.
10 ZCOMMON-KEY1 PIC X(10).
10 ZCOMMON-KEY2 PIC X(5).
05 ZCOMMON-DATA.
10 ZCOMMON-ITEMS PIC X(30).
*> from ZREC01 COPYBOOK
01 ZREC01 REDEFINES ZCOMMON.
05 ZREC01-HEADER.
ZREC01-KEYS PIC X(15).
05 ZREC01-DATA.
10 ZREC01-ITEMS.
15 ZREC01-ITEM1 PIC X(5).
15 ZREC01-ITEM2 PIC X(3).
10 ZREC01-COMPL PIC X(22).
*> from ZREC02 COPYBOOK
01 ZREC02 REDEFINES ZCOMMON.
05 ZREC02-HEADER.
ZREC02-KEYS PIC X(15).
05 ZREC02-DATA.
10 ZREC02-ITEMS.
15 ZREC02-ITEM1 PIC X(30).
10 ZREC01-COMPL PIC X(0).
This process of calculating the length of zones can only be performed at compile time: using conditional compilation does not seem to meet this need.
This need mainly concerns declarations of areas in REDEFINES.
The compiler already does some calculations internally since it allows REDEFINES with longer (and shorter) descriptions and in this case reserves memory for the longer description.
Perhaps part of the solution could be achieved by a mechanism that automatically calculates the lengths:
*> from ZCOMMON COPYBOOK
01 ZCOMMON.
05 ZCOMMON-HEADER.
10 ZCOMMON-KEY1 PIC X(10).
10 ZCOMMON-KEY2 PIC X(5).
05 ZCOMMON-DATA.
10 ZCOMMON-ITEMS PIC X(*).
*> from ZREC01 COPYBOOK
01 ZREC01 REDEFINES ZCOMMON.
05 ZREC01-HEADER.
ZREC01-KEYS PIC X(15).
05 ZREC01-DATA.
10 ZREC01-ITEMS.
15 ZREC01-ITEM1 PIC X(5).
15 ZREC01-ITEM2 PIC X(3).
10 ZREC01-COMPL PIC X(*).
*> from ZREC02 COPYBOOK
01 ZREC02 REDEFINES ZCOMMON.
05 ZREC02-HEADER.
ZREC02-KEYS PIC X(15).
05 ZREC02-DATA.
10 ZREC02-ITEMS.
15 ZREC02-ITEM1 PIC X(30).
10 ZREC01-COMPL PIC X(*).
The last area of a description (in a group), with a PICTURE X(*) adjusts its length relative to the other descriptions in REDEFINES.
Idea priority | Low |
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 idea is being discussed further.