• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: Sorting In Teraspace

    January 29, 2018 Jon Paris

    In an earlier tip, Teraspace To The Rescue, I discussed how to use teraspace in RPG to permit the storage and manipulation of data that requires more storage than RPG’s 16MB limit. In this tip I am going to discuss how such data can be sorted. Hint: SORTA won’t work!

    Before I get to that though, there is one thing I should mention. In that original tip I said: “For reasons I have never understood, DEALLOC will not null your pointer. So it is a good idea to do it yourself. . . .” IBM’s Barbara Morris pointed out, …

    Read more
  • Guru: Using Curl To Interact With Web Services

    January 22, 2018 Jacob Holt

    There have been times where I have had to collect or enter data into vendor websites. While usually this was not a hassle, it was an uncommon function of my job. However, it wasn’t long before the standard business process got unbearable. I began looking for ways to automate those tasks by using the command-line program Curl to get and post data to vendor web services.

    Curl is an open-source program that supports a plethora of internet protocols for transferring data. With its wide-ranging parameters, this program offers much power for automating tedious tasks. But just like other highly flexible …

    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: 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: Wow! I Could Have Had Long Column Names! – Take 2

    October 23, 2017 Ted Holt

    In 1990, three computer science professors named Gorla, Benander, and Benander wrote about debugging effort in COBOL programs. Among their claims was that debugging is easier if variable names were between 10 and 16 characters long. The original native data definition facilities allowed variable names up to 10 characters, but nowadays we can define alias names that Gorla, Benander, and Benander would be proud of.

    It is common in many DB2 for i shops to have physical files with field names of six characters or less. This practice dates to predecessor systems, such as the System/36, for which the …

    Read more
  • Guru: Fundamentals Of Prototyping, Part 1

    July 24, 2017 Jon Paris

    In my series on parameter passing fundamentals, I mentioned the importance of using prototypes to help ensure consistency of parameter definitions; i.e., to help ensure that the parameter passed to the called routine matches what is expected. After that article was published, it came to my attention that many of my readers were unaware of some of the additional capabilities of prototypes, in particular that prototypes can not only identity errors in parameter usage, but that in some cases they can actually fix them for you!

    Before we can begin, though, it would be a good idea to ensure that …

    Read more
  • Guru: How Do You Do That With RDi? Part 3: Complex Compiles

    June 19, 2017 Susan Gantner

    In an earlier tip I tried to convince RDi users to give up compiling in PDM because the RDi compile interface has the time-saving Error List to offer. I offered some tips that help me with my compiles in RDi. Here I’ll continue my “Compile in RDi” campaign by offering some additional ideas for those who have more complex compile processes.

    There are two common issues I hear that keep people returning to PDM for their compiles. One is that their library lists aren’t set up correctly for the compile and the other is that they need to do something …

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

    June 12, 2017 Ted Holt

    I once fancied myself a logical thinker. I changed my mind when I started programming computers. I quickly realized that I was incapable of writing an error-free program. Chalk up another valuable lesson to experience. More experience taught me to program for both expected and unexpected conditions, and now I apply that concept to all languages that I use, including SQL PL.

    SQL PL has excellent exception-handling methods, and they’re not hard to use. In this article and Part 2 to follow, we look at how DB2 informs you that your SQL request worked correctly or not. Next, we’ll take …

    Read more
  • Guru: How To Cancel A Bad SQL Update

    May 15, 2017 Ted Holt

    In Three Ways To Manage Unmatched Data I wrote about the use of the RAISE_ERROR function to force a SELECT statement to cancel when unmatched data is considered a fatal error. Another good use of RAISE_ERROR is to force an UPDATE statement to cancel when an invalid condition occurs.

    To illustrate, imagine that you and I work in a factory. All factories have inventory. The people we serve purchase some inventory items and manufacture others. Our job is to write a program that will allow certain people to zero out the inventory balance for certain types of purchased items.

    The …

    Read more
  • Replacing Source in The Twenty-First Century

    October 18, 2016 Ted Holt

    In Searching Source in The Twenty-First Century, I introduced the use of regular expressions for searching within a source member. Searching is great, but sometimes you need to replace what the system finds with something else. Here’s how to replace text when using regular expressions.

    Let’s begin with a source member.


    Notice that there are nine constants named Stat10 through Stat90. Let’s replace
    Stat with Status_. Obviously we can’t replace Stat with Status everywhere it’s found. That would be disastrous!

    Instead, let’s use a regular expression to find the instances where Stat is followed by a digit.


    I

    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26
  • 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

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