Skip to Main Content
IBM Z Software


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


Shape the future of IBM!

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:

Search existing ideas

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 your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

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.

Status Not under consideration
Workspace COBOL Compilers
Categories z/OS
Created by Guest
Created on Sep 28, 2025

Enterprise COBOL - Conditional compilation variables containing the names of the current Division, Section, and Paragraph

Hi,

We would like to have conditional compilation variables containing the current Division, Section, and Paragraph names at compile time:

  • IGY-DIVISION-NAME, (force name to uppercase, default is space if before ID DIVISION)

  • IGY-SECTION-NAME, (force name to uppercase, default is space and reset to space at new division)

  • IGY-PARAGRAPH-NAME, (force name to uppercase, default is space and reset to space at new section)

This is to group all the parts related to the same functionality into a single Copybook and then filter them using conditional compilation when including the single Copybook at the appropriate locations.

This would allow for a better view of the code associated with a unique feature by grouping it into a unique Copybook.

We can also see the Copybook as a kind of macro with parts that are activated depending on the context of use.

Another use case: having a single Copybook describing a structure in Working-Storage Section with VALUEs, and in Linkage Section without VALUE.

Sample copybook THECOPY:

       >>evaluate IGY-DIVISION-NAME
>>when 'DATA'
>>evaluate IGY-SECTION-NAME
>>when 'WORKING-STORAGE'
01 :PREF:-DATAITEM PIC X(10) VALUE 'HELLO !'.
>>when 'LINKAGE'
01 :PREF:-DATAITEM PIC X(10).
>>end-evaluate
>>when 'PROCEDURE'
display :PREF:-DATAITEM
>>end-evaluate

Sample program:

       IDENTIFICATION DIVISION.
PROGRAM-ID. THEPROG.
DATA DIVISION.
WORKING-STORAGE SECTION.
copy THECOPY replacing ==:PREF:== by ==MAIN==.
PROCEDURE DIVISION.
MAIN.
copy THECOPY replacing ==:PREF:== by ==MAIN==.
call "THESUB" using MAIN-DATAITEM
.
BYE.
goback.
*> nested subprogram
IDENTIFICATION DIVISION.
PROGRAM-ID. THESUB.
DATA DIVISION.
WORKING-STORAGE SECTION.
LINKAGE SECTION.
copy THECOPY replacing ==:PREF:== by ==SUB==.
PROCEDURE DIVISION USING SUB-DATAITEM.
SUB.
copy THECOPY replacing ==:PREF:== by ==SUB==.
.
BYE.
goback.
*> end of subprogram
END PROGRAM THESUB.
*> end of main program
END PROGRAM THEPROG.
Idea priority Low
  • Admin
    Basil Kanneth
    Nov 19, 2025

    Hi Denis, we have reviewed this idea further. However it poses as a technical limitation.

    During the conditional compilation phase, we don't know which section we're in as we haven't reached the scanning phase yet. This would prevent us from being able to implement this idea. As a result, we will be rejecting this idea.

  • Admin
    Basil Kanneth
    Oct 22, 2025

    This idea is being reviewed further.