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 Future consideration
Workspace COBOL Compilers
Categories z/OS
Created by Guest
Created on Jan 24, 2024

Create a new compiler option, SSCHECK, to validate the value of subscripts used in table references

The compiler is able to catch the situation where a subscript for a table reference is hard-coded as zero.  For example:

000037           DISPLAY "W-VALEUR-O2(0 J) = <" W-VALEUR-O2(0 J) '>'
results in this compiler error:
37 IGYPS2017-E  "0" was found as a subscript. A value of 1 was assumed.

The compiler is not able to catch the situation where a derived/calculated subscript for a table reference is zero.  For example:
000005        WORKING-STORAGE SECTION.          
000011        01 TABLEAU.                       
000012             02 TAB1 OCCURS 5.              
000013                  03 EL-TAB1.                 
000014                       04 EL-TAB1-CHAR PIC X(2).
000015                       04 EL-TAB1-NUM  PIC 9(3).
000016                  03 EL-TAB2 OCCURS 5.        
000017                       05 W-VALEUR-01 PIC 999.  
000018                       05 W-VALEUR-02 PIC 999.  
000019        PROCEDURE DIVISION.
000020            MOVE 0 TO J                                          
000021            DISPLAY "W-VALEUR-01(2 0) = <" W-VALEUR-01(2 J) '>'  
000022            DISPLAY "W-VALEUR-02(2 0) = <" W-VALEUR-02(2 J) '>'  
000023                    GOBACK.          
results in no error produced by the compiler.                            

SSRANGE is designed to check the resulting address of the table reference, not the value of the subscript itself.

SSRANGE is able to catch the situation when the resulting address referred to by a subscript falls outside the boundary of the table.  For example:

000006                WORKING-STORAGE SECTION.                          
000007                01 MYLIST.                                        
000008                   03 ARR1 OCCURS 10 TIMES.                       
000009                      04 ARR2 OCCURS 10 TIMES.                    
000010                         05 ARR-D1 PIC X(10).                     
000011                01 IDX PIC 9(9) VALUE 0.                          
000012                                                                  
000013                PROCEDURE DIVISION.                               
000014                    MOVE 'HELLO' TO ARR-D1(IDX 6)                 
000015                    DISPLAY 'ARR-D1(IDX 6) = <' ARR-D1(IDX 6) '>' 
000016                    GOBACK.                                      

IGZ0304W The reference to table ARR1 by verb number 1 on line 14 in program TABLE3 addressed an area outside the
        region of the table.                                                                                   
IGZ0304W The reference to table ARR1 by verb number 1 on line 15 in program TABLE3 addressed an area outside the
        region of the table.                                                                                   
ARR-D1(IDX 6) = <HELLO     >          

SSSRANGE is not able to catch the situation when the resulting address referred to by a subscript falls inside the boundary of the table, but the subscript value itself is zero.  For example:

000006                WORKING-STORAGE SECTION.                          
000007                01 MYLIST.                                        
000008                   03 ARR1 OCCURS 10 TIMES.                       
000009                      04 ARR2 OCCURS 10 TIMES.                    
000010                         05 ARR-D1 PIC X(10).                     
000011                01 IDX PIC 9(9) VALUE 0.                          
000012                                                                  
000013                PROCEDURE DIVISION.                               
000014                    MOVE 'HELLO' TO ARR-D1(6 IDX)                 
000015                    DISPLAY 'ARR-D1(6 IDX) = <' ARR-D1(6 IDX) '>' 
000016                    GOBACK.                                      

ARR-D1(6 IDX) = <HELLO     >           


This request is to add a new compiler option, SSCHECK, which will check the actual value of each subscript when it is used in a table reference to see if it is zero.  If it is zero, either a warning message or abend will occur, depending upon whether the MSG or ABD suboption of SSCHECK.  

In theory, this SSCHECK could also be expanded to include a ZERO/ALL suboption.
ZERO:  Flag a subscript only if it is set to zero.
ALL:  Flag a subscript if it is zero or less than the lower boundary in the OCCURS clause or greater than the upper boundary in the OCCURS clause for the table it is referencing.

SSCHECK(ALL,ABD) would produce an abend in this case, even though SSRANGE would not.

000006                WORKING-STORAGE SECTION.                          
000007                01 MYLIST.                                        
000008                   03 ARR1 OCCURS 10 TIMES.                       
000009                      04 ARR2 OCCURS 10 TIMES.                    
000010                         05 ARR-D1 PIC X(10).                     
000011                01 IDX PIC 9(9) VALUE 11.         <= Greater than 10                
000012                                                                  
000013                PROCEDURE DIVISION.                               
000014                    MOVE 'HELLO' TO ARR-D1(6 IDX)                 
000015                    DISPLAY 'ARR-D1(6 IDX) = <' ARR-D1(6 IDX) '>' 
000016                    GOBACK.                                                                                                   
 

Idea priority Low
  • Admin
    Basil Kanneth
    Reply
    |
    Apr 10, 2024

    Hi, this Idea is being accepted. but in a different context. The intention is to update SSRANGE (without an new suboption) to automatically check subscripts to make sure they are within the bounds of the OCCURS clause.

    This idea will be updated further once we put it into plan.

  • Admin
    Basil Kanneth
    Reply
    |
    Feb 20, 2024

    This idea will be investigated further and will be updated once a decision has been made.