• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • A Bevy of BIFs: %SCAN and %CHECK

    February 25, 2009 Jon Paris

    From recent questions on Internet lists, and from one-on-one discussions with RPG programmers, it seems that many are confused about the usage and operation of a number of built-in functions (BIFs). In particular the BIFs %XLATE, %REPLACE, %SCAN, and %CHECK seem to cause a lot of confusion. In this tip, I focus on %CHECK and %SCAN. I’ll look at the other misunderstood pair, XLATE and REPLACE, in a future tip.

    The %SCAN BIF has been with us since V3R7, when it was introduced along with %EDITC and %EDITW, to improve string handling. %CHECK, on the other hand, is a relative

    …

    Read more
  • Easily Avoid a Common Data Structure Error

    February 25, 2009 Ted Holt

    A shop with which I’m acquainted had an undesirable experience recently. A program that, to my understanding, had been working properly, ended abnormally. The error could have easily been avoided, had the programmer followed one simple rule of thumb.

    Take a look at the following program fragment.

    D MyData          ds                 
    D  OneField                      4a  
    D  TwoField                      7p 0
    D  RedField                      3s 0
    D  BlueField                     5u 0
    D                                    
    D Number          s             15p 5
                                         
     /free                               
         Number = TwoField;              
    

    If the calculation is the first executable statement in the program, what is the new value of Number? The answer is that Number never gets

    …

    Read more
  • Admin Alert: Robot/SCHEDULE’s DST Work-Around and More

    February 25, 2009 Joe Hertvik

    Rather than cover one topic this week, let’s look at three issues that recently crept into my in-box. I’ll explain some additional work you may need to perform to keep Help/Systems’ Robot/SCHEDULE software running fat and happy during Daylight Saving Time changes; go over my updated list of i5/OS system monitoring tools; and expand on what type of post-upgrade backups you should perform after an i5/OS software upgrade.

    Another Daylight Savings Problem To Worry About

    United States Daylight Savings Time (DST) begins this year on March 8, 2009.

    Believe it or not, it’s only been since i5/OS V5R3 that IBM

    …

    Read more
  • A Bevy of BIFs: Getting a Date is Easy with %Date

    February 18, 2009 Susan Gantner

    Almost every kind of business application uses dates. Hopefully you’re taking full advantage of all the RPG support for date data types to simplify your logic. If you’re using more than one line of code to calculate the number of days, months or years between two dates, or to add a number of days, months, or years to a date, you’re working way too hard!

    Many of the “dates” we deal with come from a screen or a database file and aren’t true date data type fields. They are numeric or character fields that contain values that we treat as

    …

    Read more
  • Mismatched Record Name Formats? No Problem!

    February 18, 2009 Hey, Ted

    We have two sets of order files–one current and one history–with the same fields but different record format names. (Who knows why?) The two inquiry programs use the same display file; and yours truly forgets to make changes in the history program when he changes the current program. I get the big brain idea to use the same program for both, but how do I override the history file to the current file when the record format names do not match?

    –David

    Let’s suppose your two files are called CURYRSLS (current year sales) and SLSHIST (sales history). The record formats

    …

    Read more
  • Admin Alert: Solving i5/OS Inquiry Message Whodunits

    February 18, 2009 Joe Hertvik

    Occasionally, a user, operator, administrator, or programmer will incorrectly answer an i5/OS inquiry message, causing system problems. When that happens, it can help to quickly discover how the message was answered, if only to prevent the offending job or user from incorrectly answering it again. This week, I’ll look at some investigative techniques for answering that classic i5/OS question: Who answered that inquiry message?

    Using QSYSOPR To Find An Answering Job

    While investigating inquiry message whodunits, an administrator’s first instinct is to display the system operator message queue (QSYSOPR) where the inquiry message originally appeared. When inquiry messages are fresh,

    …

    Read more
  • A Bevy of BIFs: Look Up to %LookUp

    February 4, 2009 Susan Gantner

    The %LookUp built-in function is more than just a simple replacement for the LOOKUP operation code to allow use in /Free format logic. It offers the option of supercharging the performance of an array search operation.

    Let’s cover the basics first.

    %LOOKUP( searchfor : array {: startindex {: numelems}})
    

    The first parameter is the argument you’re searching for, and the second parameter the name of the array where you’re looking; i.e., what would have been specified in Factor 1 and 2 of the LOOKUP op code, respectively. The optional third parameter is the starting index for the search, i.e., what

    …

    Read more
  • Treasury Of New DB2 6.1 Features, Part 1: Query Enhancements

    February 4, 2009 Michael Sansoterra

    Once again I am happy to report that IBM has provided us with a wealth of enhancements to DB2 in this monumental V6R1 release. Incidentally, in case you haven’t heard, IBM is now calling our favorite database by the name DB2 for i (formerly known as DB2/400 and DB2 UDB for iSeries) and our favorite OS is called IBM i version 6.1. Now without further ado, I’ll start to rattle off some query enhancements offered in this release.

    VALUES in SELECT

    The VALUES clause can now be placed within the FROM clause of a SELECT statement or as a derived

    …

    Read more
  • Admin Alert: Time Gobbling Tasks for a System Upgrade

    February 4, 2009 Joe Hertvik

    Last week, I discussed four critical things to beware of during an i5/OS system upgrade. This week, let’s look at a fifth critical item: upgrade time. I’ll examine a few necessary and optional procedures that can add extra time to your upgrade process, and I’ll explain the benefits that each procedure can bring you.

    When planning your i5/OS upgrade window, be sure to take into account the following critical issues that will add extra time to your upgrade process. Some of these issues are optional and provide additional benefits as you move to a new operating systems. Other items

    …

    Read more
  • How To Read A Program

    January 28, 2009 Steve Kilner

    When you have to figure out a big, complicated program you’re not familiar with, what do you do? Can you explain the process you go through? If you’re a manager of people who maintain programs, what do you know about how they figure out programs? How are they doing it? Are they doing it efficiently? Correctly?

    Research studies have shown that maintenance programmers spend about half their time trying to figure out the programs they are tasked with modifying. That’s half the maintenance budget. What can be done to improve this process, to increase quality, value delivered, and speed to

    …

    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