• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: Use SQL To Find Duplicate Source Code

    March 12, 2018 Ted Holt

    According to Brian Tracy, “good habits are hard to develop but easy to live with; bad habits are easy to develop but hard to live with. The habits you have and the habits that have you will determine almost everything you achieve or fail to achieve.” This is as true in programming as in anything else we may do.

    Unfortunately, even those of us who strive for good work habits often have to follow the work of people who did not. One bad habit I come across occasionally is known in software engineering as WET solutions. WET stands for “write …

    Read more
  • Guru: Three Suboptimal I/O Practices

    February 5, 2018 Ted Holt

    I have on numerous occasions looked at source code that I had written in previous years and asked myself, “Why on earth did I do that? What could I have been thinking?” We live and learn, or at least we hope we learn. Today I share three database practices that I see from time to time that can be simplified. Maybe there’s something for you to learn today.

    Before I share the three examples, let me say that I do not consider the more cumbersome code to be wrong. To my way of thinking, any code that produces the correct …

    Read more
  • Guru: An Update Conundrum Finally Solved!

    January 8, 2018 Ted Holt

    Russ writes, “Hey, Ted! I was trying to use a pure SQL solution to adjust some data today. My SQL statement worked fine in quality control, but failed in production. I’ve been wondering if the failure was caused by the database or by me! My problem was to renumber sequence numbers for a customer in a table.”

    Russ’s question arrived in my inbox on February 1, 2012. Yes, almost six years ago. At the time, I couldn’t help him. But with the latest technology refreshes from IBM, there is now a way to make the update work properly, and I’m …

    Read more
  • Guru: A Handy Function for Unit Testing

    December 4, 2017 Paul Tuohy

    I would like to share a technique I use for dealing with lists in an RPG unit test program. According to Wikipedia, “. . . unit testing is a software testing method by which individual units of source code, sets of one or more computer program modules together with associated control data, usage procedures, and operating procedures, are tested to determine whether they are fit for use.”

    In the world of modern RPG, this translates to writing “test” programs to test a specific piece of code. For example, when I write a subprocedure, I will write a test program that …

    Read more
  • Guru: Using SELECT * With Cursors

    November 27, 2017 Ted Holt

    From time to time someone brings to my attention the use of SELECT * with SQL cursors in RPG programs. Specifically, is that a good idea or a bad idea? I have learned that the answer to that question is “It depends.” Using SELECT * in a cursor declaration may or may not get you into trouble.

    To set the stage, let’s begin with a simple example — an RPG program that reads one table (physical file) and prints each row (record). Even though most programs use data from more than one table, programs that read only one table are …

    Read more
  • Guru: Faster Fetching, Revisited

    November 13, 2017 Paul Tuohy

    While visiting a client recently, I was shown how they were using a multi-row FETCH into a multiple-occurrence data structure to retrieve large sets of data. When I asked why they were not using a data structure array instead, I was referred to an IT Jungle article in which Ted Holt answered a question on whether it was faster to perform a row-at-a-time FETCH or a multi-row FETCH when using embedded SQL.

    Ted provided a comparison between a row-at-a-time FETCH, a multi-row FETCH into a data structure array, and a multi-row FETCH into a multiple-occurrence data structure. At the end …

    Read more
  • Guru: Error Handling in SQL PL, Part 2

    October 16, 2017 Ted Holt

    In the previous episode of this exciting, action-packed series, I introduced you to the exception-handling methods that IBM has built into SQL PL. The cliff-hanger has lasted four months now, much too long. It’s high time I explained RESIGNAL, as I promised I would. I will explain SIGNAL while I’m at it.

    Before I start the syntax lesson, I need to explain a bit of philosophy. I use the hit-the-ball-drag-Harry method of exception-handling when I embed SQL in RPG and COBOL programs. That is, I execute a command, test the SQL state, execute a command, test the SQL state, …

    Read more
  • Guru: Making Sense of Codes

    October 9, 2017 Ted Holt

    I have most likely never seen your database, yet I can tell you with confidence that it is full of codes. We can’t live without them. Codes give us shortcuts for all sorts of types and categories. They consume less storage than the values they represent. They help us keep the database clean and consistent within itself.

    But they surely can be hard to read. Some codes are obvious. M for male and F for female, for instance. My experience is that most are not so. Look at this and see how much sense you can make of it.

    select 
    …

    Read more
  • Guru: IBM i, .Net, and XMLSERVICE Program and Subprocedure Calls

    September 25, 2017 Richard Schoen

    Our businesses have years of existing IBM i legacy applications that contain priceless business logic. We need to re-purpose that code without re-writing so our existing IBM i business logic can be accessed and used by our desktop applications, web applications, web services, and mobile device applications, which often expect JSON or XML-based data. Instead of re-writing your existing business logic, surface it so the code can be called as-is.

    For this article we’ll focus on the XMLSERVICE remote program call and remote subprocedure calls that can be used to call existing logic based in existing RPG, COBOL and CL …

    Read more
  • Guru: Teraspace To The Rescue

    August 14, 2017 Jon Paris

    Hey, Jon:

    My team has been trying to resolve a problem for the last few weeks and they are running into several obstacles. The main one has to do with RPG restrictions for data structure length.

    We use a third-party program to process transactions. In the latest version, the vendor has increased the length of the fields in the data structure that we have to pass them. After our programs were changed to accommodate this increase, the RPG program would not compile because the DS exceeds 16,733,104 bytes. The vendor has told us to use teraspace but by itself that …

    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