• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: Getting Started With The Code 4 i Extension Within VS Code

    January 22, 2024 Gregory Simmons

    The Code for IBM i extension is growing in popularity and has certainly become my favorite source code editor. This article is not an attempt to convince you to drop RDi and switch to VS Code. Rather, I aim to share with you a few of my favorite settings and features in VS Code.

    Join In The Discussion

    Can’t figure out how to do something? Have a suggestion for a new enhancement? I am continually impressed with the speed at which I get responses when I post something. The team of coders and contributors to the Code for IBM i …

    Read more
  • Guru: Using Mixed Lists To Add “Data Structures” To CL Commands

    January 15, 2024 Ted Holt

    I can’t remember the last time I worked on an RPG program that had no data structures, but it was probably on a System/34. Everybody uses data structures, and with good reason – they are as handy as a pocket. When writing CL commands, it is possible to include parameters that are formatted as data structures. IBM calls them mixed lists. In the following paragraphs, I show how this is accomplished.

    You may not realize it, but you have used IBM-supplied commands that have mixed-list parameters. For example, the Copy File (CPYF) command has several such parameters: FROMKEY, TOKEY, INCCHAR, …

    Read more
  • Guru: Partitioning Result Sets Using SQL

    November 27, 2023 Mike Larsen

    While working on a project recently, I needed to retrieve attributes of an item. While that sounds like a simple task, there was a twist. While reviewing the contents of the item master table, I noticed there could be multiple rows for the same item and each row was active and valid from a business perspective.

    I won’t get into the business end of it, but my goal was to return the most recent iteration of the item for further processing in the program. After doing some research and trying some potential solutions, I came across the SQL partition by …

    Read more
  • Guru: Procedure Driven RPG Means Keeping Your Variables Local

    November 6, 2023 Gregory Simmons

    One of the things I love most about procedure driven RPG is that it allows me to keep my variables locally defined. Imagine this horror story that happens all too often in RPG shops.

    Jake: “Hey Gregory, Accounting just called; seems the rebalancing report program is acting up. Didn’t I hear you were working on that the other day?”

    Me: “Ugh, yes. All I had to do was reset this field that was used to show or not show the totaling line between branches. I tested in my library and the fix worked fine.”

    Jake: “Yeah, I had to change …

    Read more
  • Guru: The Transition From Modern RPG IV To Modern SQL

    October 30, 2023 Bob Cozzi

    Seven or eight years ago I was working with a client who needed more contemporary reporting than provided by the legacy Query/400 product. Initially I looked at Db2 Web Query and realized the documentation was sparse and the tutorials for most things, even “getting started” were virtually non-existent. It was also about four times more expensive than I felt it was worth to a P05 or P10 client. I mentioned the documentation issue to the folks at IBM and they agreed. Some of it was eventually resolved, but not enough in my opinion to get the masses to replace Query/400 …

    Read more
  • 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: 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

Previous Articles Next Articles

Content archive

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

Recent Posts

  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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