• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: When %SCAN Isn’t Sufficient

    June 24, 2019 Ted Holt

    The RPG %SCAN built-in function is wonderful! I can still remember having to look for a string within a string using RPG II on System/36. What an ordeal that was! Yet in some situations %SCAN can’t do all I need it to do. In those cases, I rely on the power of SQL.

    One case where SQL comes in handy is when I need a case-insensitive scan. Instead of RPG’s %SCAN function, I use SQL’s LOCATE and UPPER functions, like this:

    dcl-s  Description  char(48);
    dcl-s  pos          int (10);
    
    exec sql
       set :pos = locate ('HAMMER', upper(:Description));
    

    If Description has the …

    Read more
  • Guru: Health Indicators

    January 28, 2019 Dawn May

    In Configure Collection Services, I reviewed how you can improve the configuration of Collection Services. In this tip, I’m going to demonstrate how to easily review your Collection Services data and understand your partition’s performance characteristics using the Health Indicators.

    Navigator for i has a rich set of performance tasks, one of which is Investigate Data, also referred to as the Performance Data Investigator (PDI). The base operating system allows you to manage and visualize Collection Services data. The Performance tasks (and PDI) also support other types of performance data, but those graphical features require installing the Performance Tools …

    Read more
  • Guru: Using SQL With Multi-Membered Files

    October 29, 2018 Mike Larsen

    Recently I worked on a process that required me to update records in a file based on certain criteria. Sounds like a common request, right? Well, there was a twist. The file had multiple members and the update needed to consider all of them. Suddenly, a “simple” request became a bit more challenging.

    I knew of a few ways to work with multi-membered files, but I like to lay out all the options before deciding on a game plan. One method I considered was to perform an override of the file (OVRDBF command). That would certainly work, although I have …

    Read more
  • Guru: The Binding Directory Is The Key

    October 1, 2018 Ted Holt

    Hey, Ted:

    We license a software package to handle email on our IBM i system. When I write an RPG program that uses those routines, I can’t compile with the usual Create Bound RPG Program (CRTBNDRPG) command. Instead I have to use a two-step process — Create RPG Module (CRTRPGMOD) followed by Create Program (CRTPGM). Can you explain why this is? Even better, can you tell me if there is a way that I’m not aware of to compile with CRTBNDRPG?

    — David

    David continued, “I use CRTBNDCL and CRTBNDRPG, as they get me what I need, otherwise I am …

    Read more
  • Guru: DB2 For i XML Composition And The IFS

    June 11, 2018 Michael Sansoterra

    Hey, Mike! Regarding Composing An XML Document From Relational Data, Part 1, I have built an XML document using DB2 and i. When I run the query, I get a worthless result set. How do I use the SQL XML functions to get a usable XML file?

    This question comes from reader RA, and he doesn’t exaggerate. The result set from his XML-based query looks like this:

    ....+....1....+....2....+....3....+....4....+
    ************Beginning of data************** 
    
    XMLDATA 
    -------- 
    #CGULIB#
    
      1 RECORD(S) SELECTED.
    
     ************End of Data********************
    

    Notice that DB2 for i does nothing to make the XML attractive to human eyes as the entire XML …

    Read more
  • Guru: Ready or Not! Part 3 Of Big Changes In RDi V9.6, Compare/Merge, Code Coverage, and More

    June 4, 2018 Susan Gantner

    This is the third in my series of tips on RDi V9.6. In this one I’ll cover the new compare and merge support, along with improvements to code coverage and a few other smaller enhancements in V9.6. I originally thought this would be the last in the series, but IBM recently made available a new point release that introduced enough new features to mean I’ll be adding at least one more tip.

    Compare And Merge

    The ability to compare the content of two source members is not new to RDi, but with V9.6 the facility now offers the option to …

    Read more
  • Guru: Odds And Ends

    May 14, 2018 Ted Holt

    Little things can make a big difference. Today I am pleased to present a few short tips that may make a difference for you. I hope you get something useful here. If you have short tips that you would like to share with your fellow readers, please email them to me and I’ll see what I can do. Have a wonderful day!


    Hey, Ted:

    I just read your article More Date And Time Conversions Using SQL. Just as aside, the scalar functions Decimal/Dec, Integer, and BigInt can convert times, dates and timestamps directly into a numeric representation in the …

    Read more
  • Guru: RDi and Refactoring

    April 16, 2018 Ted Holt

    When I first heard the term refactoring, I thought, “So that’s what they call it.” I had been refactoring for years, my only tools being SEU and a compiler listing. I learned a long time ago that refactoring is often necessary to enhance code, especially poorly written code. Another reason I often refactor is to better understand poor code.

    To refactor means to rewrite source code without changing its external behavior. Due to all the “legacy” source code (RPG II, RPG III, fixed-form RPG IV, OCL, etc.) in IBM i shops, the ability to refactor source code is a …

    Read more
  • Guru: More Date And Time Conversions Using SQL

    March 26, 2018 Ted Holt

    Since many, if not most, IBM i shops store dates and times in numeric and character fields, it behooves those of us who program those systems to understand all available date- and time-conversion tools. A conversation with a fellow attendee of the recent RPG & DB2 Summit made me realize that I had not written about certain SQL conversion methods.

    IBM i programmers need to convert date, time, and timestamp data from one format to another for at least two reasons. First, we can’t do date and time arithmetic with numeric and character fields. Second, the people whom we serve …

    Read more
  • Guru: Beyond The Basics Of Code Conversion

    March 19, 2018 Paul Tuohy

    Today many RPG programmers are tasked with having to modernize existing programs. These programs often have long and varied history. They may be RPG IV programs or they may be RPG IV programs that were originally RPG II or RPG III programs, or any permutation or combination you can imagine. There are tools available to help us convert from fixed-form RPG to free-form RPG and, within RDi, we have options to help us reformat code and refactor variable names. But these tools can only go so far. We finally reach the point where we have to put fingers to the …

    Read more

Previous Articles

Content archive

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

Recent Posts

  • 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
  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23

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