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 Not under consideration
Workspace IBM i
Categories Languages - RPG
Created by Guest
Created on Oct 2, 2020

Add Object Exists Built-in Function to RPG IV

The ability to determine if a File, Data Area, User Space, Data Queue, etc. exist in simplified way becomes more and more important each day. RPG does not have the capability. We need a %EXISTS([<object-library>/]<object-name>[([file-mbr-name>)], <object-type>) built-in function in RPG IV that returns true (*ON) if the object exists, and false (*OFF) if the object does not exist.


Use Case:

Today I use QUSROBJD or the COZZI TOOLS ObjExists() subprocedure to determine whether or not an object exists. We also sometimes use the RSLVSP MI instruction as well.
The challenge is making sure wrapper interface/component is installed on the system where the application runs. Or if calling the API or MI inst directly, then the complexity of calling those interfaces is challenging to many. We need one, consistent, simple interface that checks whether an object exists or a file's member exists.


Idea priority High
  • Guest
    Reply
    |
    Oct 19, 2020

    There are CEExxxx APIs to do Math, are you suggesting we shouldn't have MATH Operations built-into RPG?
    The QCMDEXC approach may be the best choice if it actually works.
    Today in COZTOOLS, I use the RSLVSP (Resolve System Pointer) MI instruction. If the pointer is NULL, it returns false. The challenge with others doing this is that when the QTEMP library is used in the object name, a different process is involved and RPG coders aren't that interested in the "here are the 14 steps you take to get this to work sometimes" logic that I see lately. I guess since things like Open Source mean verbose bloatware implementations are commonplace, programmers today are getting used to several steps of complexity to do a simple task--similar to how PC Users got used to power-cycle/rebooting while we AS/400 world Developers that was cute.

  • Guest
    Reply
    |
    Oct 7, 2020

    Maybe I'm missing something here, but couldn't you just use the CHKOBJ command within a call to QCMDEXC and test for the %error indicator?
    cmdstr = 'CHKOBJ OBJ(objname) OBJTYPE(type)';
    Callp(e) qcmdexc(cmdstr:%len(cmdstr));
    If %error;
    object not found code
    Endif;

  • Guest
    Reply
    |
    Oct 5, 2020

    IBM does not intend to provide a solution to this request at this time, so it is being closed.

    If the requested function can be obtained by one or two procedures in a service program, new RPG built-in functions are not necessary.

    It is a normal part of ILE development that any necessary service programs must be available on all systems where the program is run.

  • Guest
    Reply
    |
    Oct 3, 2020

    As you explained there are several solutions for this so why would the IBM compiler team waste its time on writing a BIF for it ? If object distribution (a single service program) is an issue I guess you've a bigger issue than just the lack of a BIF.

    If so we could ask a BIF for the other 1000 API's that exist as well, it's the same with all those SQL functions that are developed while API's exist... pure waste of IBM resources that could better be used for those things that we can NOT do today.