• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • The Powerful SQL Upsert

    January 27, 2015 Ted Holt

    As you well know, a common task in business computing is to update an entity (customer, vendor, purchase order line, etc.) that exists, but add the entity if it doesn’t exist. In RPG this requires two operations–an update and a write–within a conditional statement. In SQL one statement handles the whole shebang. Here’s how it works.

    Here’s some RPG III code that illustrates the situation.

    FCUSTF   UF  E           K        DISK
     . . .  code omitted
    C           CUSKEY    KLIST
    C                     KFLD           COMP
    C                     KFLD           ACCT
    C*
     . . .  more code omitted
    C*                                              HILOEQ
    C           CUSKEY    CHAINCUSTREC              99
    C*
     . . 
    …

    Read more
  • Knee-Deep In Ruby Waters

    January 27, 2015 Aaron Bartell

    In Testing The Ruby Waters I introduced you to Ruby and how to use irb (interactive Ruby shell) to easily run and test Ruby code. In this article I expound on that and introduce more features of the Ruby programming language as it relates to an IBM i programmer. In particular, Ruby methods and one form of encapsulation.

    Ruby is an object-oriented language; everything in Ruby is an object. But that doesn’t inhibit Ruby from being used in a more procedural approach. Below is a Ruby program named “say_hi.rb” with a method definition of “hi”, and then the invocation of

    …

    Read more
  • Faking Create Or Replace Table

    January 20, 2015 Ted Holt

    The new CREATE OR REPLACE feature of SQL has been most helpful to me. It works for aliases, functions, masks, permissions, procedures, sequences, triggers, variables and views. It would be nice if it worked for tables, especially when I’m developing a new application. Here’s a workaround.

    The trick is to use a dynamic compound statement. If you’re not familiar with these, I recommend you read Michael Sansoterra’s excellent article on that subject.

    One of the things that dynamic compound statements let you do is include conditional logic, which is what we need. We need a way to drop a table

    …

    Read more
  • Everybody Likes Shortcuts! Part 1, Navigation

    January 20, 2015 Susan Gantner

    I’ve seen a particularly sharp increase in the use of RDi (or Rational Developer for i) by RPGers this year. I suspect that has a lot to do with the fact that it contains the only editor that supports the new V7 all-free-format version of the RPG language. Even among shops that are not planning to make use of free form D specs right away, this limitation seems to have made people realize that the writing was on the wall and that SEU’s day had come and gone.

    One way that I gauge the interest in RDi is in the

    …

    Read more
  • Regurgitating Data With DB2 For i Data Change Table References

    January 20, 2015 Hey,

    Four Hundred Guru:

    I’ve been reading your SQL articles in hopes of finding a solution to a problem. I need to insert the same data into two tables at the same time in detail form to one table and in summary form to the other. Is such a thing possible?

    I have an incoming transaction table that I want to insert into another table. The incoming transaction table has multiple columns and some of those columns are quantities (integer) fields or amount (with a decimal) fields. I want SQL to run an INSERT INTO… SELECT FROM type statement to

    …

    Read more
  • End of Year Feedback

    December 17, 2014 Ted Holt

    It’s been a wonderful year, in spite of all the difficulties, problems, and vicissitudes of life that I would rather not have faced. I appreciate all the email that you’ve sent in response to the articles we published. To know that we’ve done something to make someone’s life easier and better gives me great satisfaction. I’d like to share some of your comments with your fellow Four Hundred Guru readers. May you enjoy the holidays, and may 2015 be your best year ever.


    Hey, Ted:

    I just read Use Wireshark To Diagnose IBM i Communications Problems. You can bypass

    …

    Read more
  • In Praise Of One-Off Tools

    December 17, 2014 Ted Holt

    This is the last issue of Four Hundred Guru for 2014, and in the last issue of a year I try to write about something unusual, something different from the routine stuff we usually run in this august publication. I worked on several interesting projects in 2014, but the one I want to talk about today will seem really retrograde to you. I wrote a bunch of System/36 RPG II programs. How I wrote them is the real story.

    In early 2014, a friend of mine emailed a request. A client of his, who still runs an S/36, was going

    …

    Read more
  • Admin Alert: What Should an IBM i Administrator Do, Part 2

    December 17, 2014 Joe Hertvik

    Last week, I discussed why shops still need IBM i administrators and started describing a checklist of tasks that are well-suited for less experienced administrators. My checklist showcased duties that can easily be turned over to lower level administrators, leaving more experienced people free to complete projects that benefit your organization. Today, I’ll complete describing the IBM i administrator checklist.

    The Checklist Continued

    As discussed last week, here’s a starter list of duties that can easily be turned over to an IBM i system administrator.

    1. IBM i user provisioning
    2. Auditing the system
    3. Software setups and on-going software database maintenance
    4. Backup
    …

    Read more
  • Fuzzy Matching In RPG

    December 3, 2014 Ted Holt

    Note: The code accompanying this article is available for download here.

    SQL allows you to use wildcard characters with the LIKE operator to search a column for a pattern. As they say in the GEICO commercials, “Everybody knows that.” Well, did you know you can do the same thing in RPG programs?

    If you’re not familiar with LIKE, read about it here. You can use the LIKE operator to find data with inexact matches. For instance, find all customers whose names contain “ACME”.

    select * from cust
     where name like '%ACME%'
    
       ID  NAME
    =====  ==========================================
    19883  ACME 
    …

    Read more
  • TR8 DB2 For i Enhancements, Part 2

    December 3, 2014 Michael Sansoterra

    In the first part of this series, I introduced several of the DB2 for i enhancements made in IBM i 7.1 Technology refresh 8 (and in IBM i 7.2).

    These enhancements were of interest to developers and administrators. Likewise, this second set of enhancements we are about to review will be of interest to developers but may hold even greater interest for those in an administrative role.

    QSYS2.GET_JOB_INFO enhancement

    This DB2 for i service table function has two new enhancements:

    1. The job parameter now accepts the special value ‘*’ to return information about the current job.

    2. New

    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19
  • IBM Unveils Manzan, A New Open Source Event Monitor For IBM i
  • Say Goodbye To Downtime: Update Your Database Without Taking Your Business Offline
  • i-Rays Brings Observability To IBM i Performance Problems
  • Another Non-TR “Technology Refresh” Happens With IBM i TR6
  • IBM i PTF Guide, Volume 27, Number 18

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