• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • 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
  • Guru: Speeding Up RPG By Reducing I/O Operations, Part 1

    May 8, 2023 Gregory Simmons

    Perhaps one of the easiest ways to speed up an RPG program is to reduce the number of I/O operations it needs to perform. In this article let’s explore one simple method for moving toward dataset processing.

    Here I have a simple RPG program. Okay, admittedly, we don’t often get to write “simple” RPG programs, but for this example, I have stripped the RPG program down to just the read loop so I can demonstrate the conversion.

    1     Dcl-f AcctMstr Usage(*Input) Keyed;
    2     Dcl-pr entry ExtPgm('RPGRPT1');
    3       n Packed(3:0);
    4     End-Pr;
    
    5     Dcl-pi entry;
    6       inBranch Packed(3:0);
    7     End-pi;
    
    8     
    …

    Read more
  • Guru: String Manipulation Using SQL

    October 24, 2022 Mike Larsen

    Recently, I was working with an employee file where first and last name were concatenated with a comma separator. A requirement of the project was to parse the name and populate a different table where first and last name are separate columns. I won’t address the design of the employee file, but I will show how I completed the request.

    In Figure 1, I use the position string function via SQL to extract the first name.

     

     

    Figure 1. Extract first name

     

    In this example, I use the trim, substring, and posstr functions to position to the first …

    Read more
  • Guru: Beware of SQL Precompiler Variables

    September 26, 2022 Ted Holt

    In a famous Henny Youngman joke, a patient says, “Doctor, it hurts when I do this,” to which the doctor replies, “Then don’t do that.” Corny jokes aside, I have spent decades trying to identify programming practices that hurt when I do them, and having identified them, cease to do them. A case in point is the misuse of the variables that the SQL precompiler defines in my RPG programs, variables such as SQLCODE, SQLSTATE, and SQLER3.

    “So what,” I hear you ask, “is the problem with these variables? ” Well, they’re global, and global variables are evil.   Global …

    Read more
  • Guru: The SND-MSG Op Code And Message Subfiles

    September 12, 2022 Ted Holt

    If you’re one of the many IBM i programmers who still writes green-screen applications, think about how your programs communicate with the users. How do you tell a user that a value that he’s just entered is invalid, or that he needs to press a command key to proceed? I’ve seen several methods, but a common one — and my favorite — is to communicate through a message subfile.

    The nice thing about message subfiles is that I can report two or more messages at one time. I like the computer to find as many errors as possible and let …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • Public Preview For Watson Code Assistant for i Available Soon
  • COMMON Youth Movement Continues at POWERUp 2025
  • IBM Preserves Memory Investments Across Power10 And Power11
  • Eradani Uses AI For New EDI And API Service
  • Picking Apart IBM’s $150 Billion In US Manufacturing And R&D
  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20

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