Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. 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 IBM i
Categories Languages - RPG
Created by Guest
Created on Dec 3, 2023
Merged idea
This idea has been merged into another idea. To comment or vote on this idea, please visit IBMI-I-1111 Option for EXTNAME/LIKEREC(*NULL) to create SQL-type int(5) indicator subfields.

Ability to easily create a data structure with a null field map to correspond to a record’s DS to be used for SQL retrieval. Merged

When defining a structure in RPGLE to be used on SQL I/O such as fetch or select, today we use DCL-DS @myds qualified… containing either subfields or auto generated subfields using a reference to an external file name, ie. extname(‘TABLE’) resulting in a lay-out of the fields for the SQL columns to be retrieved. We  select or fetch (select * into :@myds from table) or (select name, address, state into :@myds from table) into the data structure. If there are null fields, it would be helpful to programmers, if an RPG LIKEDS keyword could be used to define a null indicator data structure to correspond to the fields in structure defined to hold the database record. I believe something like this exists for record level access files using LIKEREC? Is it possible to do similar with the LIKEDS keyword? 


Today the SQL for handling nulls uses something like this:

(select * into :@myds :@mydsNull from table) or (select name, address, state into :@myds :@mydsNull from table) this would not change. Only seeking to make a duplicate DS for null indicators, to correspond  to whatever is defined for @myds. 

Maybe  DCL-DS @mydsNull  LIKEDS( @myds: *NULLIND ) qualified; would work, to create a structure containing type indicator, for as many fields as are defined in the companion database @myds DS. The  programmer could reference as:

 IF @mysdnull.name; 

to determine if  name field contained a null value? Rather than hand code separate names, a  programmer would no longer have to manually define null indicator fields named similarly to the database column name, nor code the names followed by indicator fields in the sql. The new support would enable doing (select * into :@myds : @mydsNull from table) but the DS for the null fields would have been created by a single statement. 

Sadly, fixed and free versions of this would be nice for folks who aren’t allowed to use free-format by their managers. 

Idea priority Medium
  • Guest
    Reply
    |
    Jun 10, 2024
    Your request is being answered as duplicate of IBM Idea IBMI-I-1111, https://ibm-power-systems.ideas.ibm.com/ideas/IBMI-I-1111.

    Your Idea has two aspects. The first aspect is already available. The second aspect is a duplicate of IBMI-I-1111.
    1. Create an externally-described data structure where the subfields have the same names as the fields in the file, but they have the indicator data type.
    2. Have those indicators defined as the SQL-type of null indicator (2-byte integer) so it can be used in an SQL select statement.

    The first aspect of your request, to use *NULLIND with LIKEDS, is already possible, although you would use EXTNAME or LIKEREC with *NULL to get a data structure with the indicator subfields.

    DCL-DS @mydsNull EXTNAME('MYFILE' : *NULL ) qualified END-DS;
    or
    DCL-F myfile;
    DCL-DS @mydsLikerecNull LIKEREC(myfileFmt : *NULL) INZ;

    @mydsNull and @mydsLikerecNull have indicator subfields with the same names as the fields in file MYFILE.
    https://www.ibm.com/docs/en/i/7.5?topic=keywords-extnamefile-nameformat-nameall-inputoutputkeynull
    https://www.ibm.com/docs/en/i/7.5?topic=keywords-likerecintrecnameextract-types

    However, this does not address the second aspect of your request, to use this data structure in an SQL SELECT statement. The subfields in a *NULL data structure are RPG indicators, with values like '0' and '1'. The @mydsNull data structure would not be supported for the SELECT statement since that expects 2-byte integers (the SQL-style of null indicator).

    The duplicated Idea IBMI-I-1111 is requesting the ability to create a data structure similar to a *NULL data structure, but with SQL-style 2-byte integer null indicators.

    -IBM Power Systems Development
  • Guest
    Reply
    |
    Feb 8, 2024

    This should be an addition to the SQL pre compiler - like the special SQL data types for CLOB, etc.

  • Guest
    Reply
    |
    Dec 7, 2023
    IBM has received your Idea and is evaluating it. IBM will provide a response after evaluation is complete.

    - IBM Power Systems Development