• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • An Introduction to Processing XML with RPG, Part 4

    November 17, 2015 Jon Paris

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

    In the first three parts of this series, I focused on the basics of using RPG’s XML-INTO. In this episode I want to wrap things up by covering two of the more recent additions to this support.

    Let’s start with namespaces. I haven’t got time to go into all the whys and wherefores of namespaces. For now let’s just say that they allow you avoid name collisions by qualifying element and attribute names. Since you will encounter them in many documents it is important to understand the

    …

    Read more
  • Formatting Dates with SQL, Take 3

    November 17, 2015 Hey, Ted

    Great technique shared! Function overloading is a real boon to SQL programming. Here’s another way that requires less code and is less invasive (i.e., you won’t have to recompile anything.)

    Leave your original FMTDATE function alone and add the following to the SQL source:

    create function xxx/fmtdate
    (inDate varchar(8), inFromFmt varchar(8), inToFmt varchar(8))
    returns varchar(10)
    language SQL
    specific FMTDATEA
    deterministic
    returns null on null input
    
    begin
     declare DateNum numeric (8,0);
     declare OutDate varchar(10);
     set DateNum = decimal(inDate);
     set OutDate = FmtDate(DateNum, inFromFmt, inToFmt);
     return OutDate;
    end
    

    I’ve used this technique to overload many user-defined functions and keep the HLL programming

    …

    Read more
  • Data Scrubbing Functions In DB2 For i

    November 17, 2015 Hey, Mike

    Imagine a character database field that stores a phone number. No formatting rules are involved, so the values in the column vary such as 8370155738, 837/015-5738, 837-015.5738, etc. We’d like to write an RPG program that allows the user to enter a number, formatted or not, onto the screen and if that string of numbers is found in the table’s phone column, show it to the user. Is there a way to use SQL to strip the non-numeric characters from the phone field, and select the record if the result matches the user input?

    –Brad

    Hi, Brad.

    Scrubbing data is

    …

    Read more

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