• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: Search Source Code For Strings Using SQL

    October 9, 2023 Bob Cozzi

    The IBM-supplied Find String Using PDM (FNDSTRPDM) command and PDM option 25 are how most developers scan for a simple value in a list of source file members. But what if you need more? For example, what if you want to find something complex, such as the field named “CUST” but not the field named “CUSTNAME” “CUSTOMER” or “CUSTNO”? Go ahead, I’ll wait?

    While I do use FNDSTRPDM all the time, I now use the SQL READSRC (Read Source File Member) Table function more often.

    READSRC SQL UDTF

    The READSRC SQL Table function or UDTF (User-defined table function) uses an …

    Read more
  • Guru: TryIT – You’ll Like It

    October 2, 2023 Ted Holt

    I have watched children play Whac-a-mole, but I’ve never played it myself, perhaps because the game unpleasantly reminds me of programs that I have had to work on. I fix one bug, only to see another bug rear its ugly little head. Life’s too short to endure such nonsense. Besides, it is embarrassing for someone to tell me that the program I supposedly just fixed is still broken.

    Suppose you’re working on a 4,000-line RPG program and you comment out lines 650-660. What you don’t realize at the time is that a variable used in line 2755 has to …

    Read more
  • Guru: Procedure Driven RPG With Linear-Main Programs

    September 11, 2023 Gregory Simmons

    A number of years ago, I started migrating away from writing subroutines and started writing procedures instead. Yes, quite often, this was simply because it was “new and shiny” and served no real benefit from their subroutine counterpart. However, as the language and I evolved, I found that my method of approaching every project was what I call procedure driven RPG.

    Let’s have a look at a simple RPG program. In this little program, to give it a purpose, I’m going to have a little fun with math and demonstrate the Fibonacci sequence:

    1	**Free
    
    2	Dcl-s i    Uns(3) Inz(3);
    
    …

    Read more
  • Guru: Retrieving The Long And Short Object Name

    August 14, 2023 Bob Cozzi

    Many releases ago, IBM i received “Long SQL Names” for files and libraries. These new longer names (up to 128 characters) were well received by SQL enthusiasts, but largely ignored by the mainstream IBM i developer. As each version of IBM i emerged, more and more shops experienced one or more objects with a longer-than-10-character name.

    Recently I created a file named BOAT_TRAFFIC. This name is clearly longer than 10 characters. I used SQL DDL (the CREATE or REPLACE TABLE statement) to create the file. Using SQL DDL is the only real way to create an object with a long …

    Read more
  • Guru: Object Usage Statistics

    July 10, 2023 Bob Cozzi

    A long time ago in a system far, far away, IBM added the Date Last Used to the Object Description for all objects on the system. The term “last used” means different things to different object types; for *FILE objects it means the file was opened or its description was changed, for *PGM objects it means the program was called, for other objects it generally means what you might think it means (viewed, retrieved/read, updated, etc.) The only exceptions are Device Descriptions which get updated when a *DEVD changes from “Vary On Pending” to some other status.

    The Date Last …

    Read more
  • Guru: Comparing IFS Directories Using SQL

    June 19, 2023 Mike Larsen

    I use SQL almost every day at my job. It may be just a query in ACS, or it may be embedded SQL in an RPG program. A few days ago, I needed to compare the contents of one IFS directory to another. Combining a few different table functions, I was able to develop a nice solution.

    Note: The code for this article can be downloaded here.

    In this example, I have a directory that has five text files in it. I have a second directory that has three text files in it, and they are the same documents …

    Read more
  • Guru: Speeding Up RPG By Reducing I/O Operations, Part 2

    June 12, 2023 Gregory Simmons

    Legacy code. Often one admits they have legacy code either with a chuckle or a wince. Nonetheless, it usually is admitted with bad connotations. We must remember though – legacy code becomes legacy code because it works. It performs its tasks day in and day out for many years and is forgotten about. Only the squeaky wheel gets the grease, right?

    The problem with this code is that, while it works, decades slip by, and technology evolves. As these decades roll along, we don’t just end up with a few programs that fit this ‘legacy code’ stereotype, we often end …

    Read more
  • Guru: Binding Directory Entries

    June 5, 2023 Bob Cozzi

    I assume you’ve heard about *BNDDIR (Binding Directory) objects introduced circa 1994 with OS/400 V3R2. The infamous QC2LE binding directory is used by a huge number of RPG applications to access C runtime and unblocked MI functions such as system cvthc, cpybytes, and matmatr. You have probably seen RPG IV source code with the BNDDIR(‘QC2LE’) keyword on the header specification.

    I was one of the first developers outside of IBM to use Binding Directories for my own code. When I go back and look at my own RPG IV code created prior to mid-2007, well over 90 percent of it …

    Read more
  • Guru: Watch Out For This Pitfall When Working With Integer Columns

    May 22, 2023 Gregory Simmons

    Remember that awesome jungle game where you had to guide the hero through a series of increasingly hard obstacles to gather treasure? Jumping over snakes, scorpions, and rolling logs, swinging on vines over alligators –your timing had to be just right. Pitfall Harry survived in a world of 255 screens, each of which were 160 x 192 pixels and a dazzling 128 colors! Well today, I want to make you aware of a pitfall which caught me off guard a while back. I hope this article will help you avoid my pitfall.

    There I was, writing my code, happy as …

    Read more
  • Guru: Find Unused Objects On IBM i Using SQL

    May 15, 2023 Bob Cozzi

    I have a client that uses SQL iQuery for nearly all “Report” type applications since SQL iQuery Version 2. They asked if they could create a report that listed all the unused objects in their user libraries. They also wanted the option to output to Excel-compatible format if desired.

    Since SQL iQuery allows you to output the results of your SELECT statements to any of its supported formats, Excel-compatible is given.

    Note: the code for this article is avaialble on GitHub at this link.

    There were a couple of approaches. I could use our other product, SQL Tools OBJECT_LIST …

    Read more

Previous Articles Next Articles

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • Positive News From The Kyndryl Mainframe Modernization Report
  • NAViGATE, inPower 2025 On Tap for September 2025
  • Guru: WCA4i And Granite – Because You’ve Got Bigger Things To Build
  • As I See It: Digital Coup
  • IBM i PTF Guide, Volume 27, Number 37
  • AI Is Coming for ERP. How Will IBM i Respond?
  • The Power And Storage Price Wiggling Continues – Again
  • LaserVault Adds Multi-Path Support To ViTL
  • As I See It: Spacing Out
  • IBM i PTF Guide, Volume 27, Numbers 34, 35, And 36

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle