RT @jalcudia: This is my proposal for the future of #IBMi to leave for @NextGenCommonEU and @COMMONug #N2i: a Long Term Release for the las…

IBMChampion Retweets (@IBMCRTWT) retweeted:

This is my proposal for the future of #IBMi to leave for @NextGenCommonEU and @COMMONug #N2i: a Long Term Release for the last 7.x version (with support for 5 – 10 years if needed) and a new 8.1 ILE only version with no place for old stuff. #ibmchampion @CommonEurope #CEAC #CAAC

– jalcudia (superalcudia) (@jalcudia)02:28 – Mar 04, 2023

#IBM i SQL Function to List BNDDIR Entries

If you’re on the very latest TR of #IBMi you can now use the IBM-supplied BINDING_DIRECTORY_INFO Table Function to get the same information as you can from the DSPBNDDIR CL command.

In my #SQLTools, I’ve had the BNDDIR_ENTRIES Table function that produces the identical information for several years. There is no API to access Binding Directory objects so my version uses the DSPBNDDIR OUTFILE support to accomplish this task.

As mentioned, the IBM-supplied BINDING_DIRECTORY_INFO is available on the latest TR of the operating system. If you are on V7R3 or later, see if you have it. If so, you don’t really need to continue reading this article, but feel free to continue.

BNDDIR_ENTRIES for #IBMi V7R2 and Later

In SQL Tools we ship the SQL User-Defined Table Function (UDTF) named BNDDIR_ENTRIES which was written to be compatible with IBMi V7R2 and later, with the exception of one line of code, which I’ll cover later in this article.

The syntax for this function follows:

SELECT * FROM TABLE( BNDDIR_ENTRIES( ‘QSYS2’, ‘QUSAPIBD’));

If you run this statement using IBM ACS or our SQL iQuery product, you will see the results for the QUSAPIBD. This binding directory is automatically included by RPG IV and C compilers. Years ago, working with IBM Rochester, we got all the entries from QC2LE included in QUSAPIBD which is why BNDDIR(‘QC2LE’) became unnecessary in RPG IV starting with IBM i V6R1.

The output from the above statement would look similar to the following.

If you’re an IBM i shop that takes advantage of Binding Directories, you probably need to know which binding directories contain certain Service Programs or Modules. the BNDDIR_ENTRIES Table Function will help with that.

Suppose you wanted to know which *SRVPGM and *MODULE objects are in the QC2LE as well as QUSAPIBD binding directores? A simple JOIN statement can be used to create this dataset:

SELECT c2.
  FROM TABLE (
         sqltools.BNDDIR_ENTRIES(‘QSYS’, ‘QC2LE’)
       ) C2
       INNER JOIN (
           SELECT *
             FROM TABLE (
                 sqltools.BNDDIR_ENTRIES(‘QSYS’, ‘QUSAPIBD’)
               ) API
         ) API
         ON (C2.OBJNAME, C2.OBJLIB) = (API.OBJNAME, API.OBJLIB)

The results from this SQL statement look like this:

Now you know which entries appear in both Binding Directories.

Binding Directories do not have an API themselves. So the only exposed way to get to those entries is via the DSPBNDDIR CL command. The BNDDIR object is a SPACE object, similar to a User Space object. Space objects are used for a variety of IBM i objects, such as *CMD, *USRSPC, and several others. For *BNDDIR objects the data is stored as fixed length segments within the space and repeats for each entry. In the old days, I would’ve written an MI program, but today I would choose the C language to get to the *BNDDIR Entries. However, today objects are locked down with System Domain and System State flags, so user code, even written in C, cannot resolve a pointer to those objects associated space. You would actually have to do a DMPSYSOBJ to a SPOOLED file, read that SPOOLED file data and extract the Entries.

The source code for the BNDDIR_ENTRIES Table function is shipped with our SQL Tools product. We include a source file named QUSRSRC (User Source) that contains functions that we deem less compelling and thus ship the source code for them.

Optional Statement

In order to perform the JOIN operation I illustrated, the BNDDIR_ENTRIES table function needs to connect one set of data with another. However, the DSPBNDDIR CL command output to a named output file. That OUTFILE can be a different name every time the command is run. Coming up with unique names can be challenging. To solve that problem SQL Tools ships with the TEMPNAME Function. This function returns a system-wide unique name. That name can be the name of a file in QTEMP or an IFS file name. To have it generate a name in QTEMP, pass in the name QTEMP as the first parameter, as follows:

DECLARE OUTFILE_NAME VARCHAR(21) NOT NULL DEFAULT ‘QTEMP/Z_BNDDIRE’;
set OUTFILE_NAME = sqlTools.tempname(‘QTEMP’);

Calling TEMPNAME() generates a name in QTEMP that is unique. This allows you to use this function in a JOIN operation as illustrate above. If you do NOT have SQL Tools, then this function does not exist on your system. If you want to use BNDDIR_ENTRIES anyway, simply comment out that one line of code that sets the OUTFILE_NAME variable. Also avoid using it in a JOIN operation with another BNDDIR_ENTRIES table function.

To learn more about any of our SQL Tools functions or obtain the source code for BNDDIR_ENTIES visit our website, download the latest SQL Tools V2R3 (announced 3 March 2023), and install them onto your IBM i system. You’ll receive a 2-month no-charge trial license automatically upon installation.

Visit: http://www.SQLiQuery.com/SQLTools for more details.

That’s all there is to it.

[Blog] Learn the 5 ways to do data #encryption on #IBMi and the pros & cons of each before deciding what would be best for your organization. Remember, we are here to support and guide you through this process when you’re ready. Read it here >>>

[Blog] Learn the 5 ways to do data #encryption on #IBMi and the pros & cons of each before deciding what would be best for your organization. Remember, we are here to support and guide you through this process when you’re ready. Read it here >>> bit.ly/41HQGFd

– Mid-Range (@MidRange1)08:09 – Mar 03, 2023

20230323 – NHMUG March 2023

New Hampshire IBM i User Group Meeting

Thursday, March 23 2023 – Fireside Inn, West Lebanon NH

 

We know it’s been a while since you’ve heard from NHMUG. But we haven’t forgotten about you.

We are going to try a live event again. So come join us in West Lebanon NH at the Fireside Inn on Thursday, March 23rd.

This time however, we are going to add a twist.  We will have three sessions with three different IBM speakers.

  

This event is free to IBM i professionals, and sponsored by NHMUG with assistance by our friends at IBM.

 We are presently having an issue with our Registration system.  To register please send a email to [email protected]  include the Name, company, number of attendees and email addresses of all attending.

 

Sessions will include:

IBM i OS 7.5

In this session Steven Fier will give an update on IBM i 7.5 and an overview of the latest and greatest tools you can gain from migrating to the latest OS version.

Updating your systems to a Power 10

Todd Boyd will speak on as you upgrade your servers there is becoming a greater focus on sustainability. Todd will show you the necessary upgrade paths and the associated core/system energy reductions and how this can lower your total ROI.  Including a roadmap overview of some of the latest hardware announcements.

Securing Remote Db2 Access

Robert Andrews will discuss the topic that is in the forefront of everyone’s mind. Security for your database is not a one and done item. There are many ways to access your system’s data from a remote connection. This session explores some of the most popular remote data access methods and discusses the various security aspects of each one.  Topics covered include passwords, encryption, and exit points.

 

                                                              About Our Presenters

IBM Webex – Register Program

Välj ett eller flera webbseminarier att delta i:

Registrera dig för valda webbseminarier

Fyll i formuläret för att registrera dig för valda webbseminarier. En asterisk (*) anger obligatorisk information.

Verified by MonsterInsights