• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Guru: The PHP Path To Victory, Part 2

    August 7, 2017 Chris Ringer

    Part 1 of this article discussed the path a PHP request takes on its way to your backend RPG program through the magic of an external SQL stored procedure. You may need to review the SQL, PHP, and RPG code there before continuing here. If you have not yet downloaded the code to your IBM i (found in Part 1), now would be a good time to do that.

    Part 2 will give you the confidence to troubleshoot those times when something unexpected occurs in this PHP environment. And if you are a developer for large company, the responsibility of …

    Read more
  • Guru: Common Table Expressions Can Replace Query Chains

    June 5, 2017 Ted Holt

    Modernization efforts often concentrate on the database and programs. That is well and good, but there is more to modernization. Replacing Query for IBM i with more modern query tools is also important. But what do you do with those queries that people depend on? More confusing, what do you do with query chains?

    A query chain is a series of queries that run one after another, consolidating and reformatting data in temporary physical files, in order to produce a resulting data set, often in report form. It’s not unusual to see small CL programs like the following one:

    PGM
    
    …

    Read more
  • Guru: The Three Ways to Insert

    May 8, 2017 Ted Holt

    The INSERT statement is THE (as in the only) SQL way to add new data to a relational database table. At the risk of sounding like a GEICO commercial, “Everybody knows that.” Well, did you know that the INSERT statement supports three distinct ways to add new rows to a table?

    To illustrate the three forms of INSERT, imagine that you and I work for a small company that stores goods in, and ships goods from, a warehouse. Since the company has only one warehouse, there has never been a need for a warehouse ID column in any of …

    Read more
  • Guru: Three Ways To Manage Unmatched Data

    April 24, 2017 Ted Holt

    Heaven forbid that I would ignore a failed RPG CHAIN (random read) operation. I always take appropriate action. Which action I take depends on the situation. The same applies to outer joins that don’t find matching data in a secondary table. Here are three ways to deal with unmatched data in an outer join using SQL.

    To illustrate, let’s use three tables from an overly simplified general ledger system. The first is a table of departments into which the business is divided. The second is a chart of accounts. The third is a transaction file that feeds the general ledger. …

    Read more
  • Guru: The XML Composition Conundrum of XMLNAMESPACES or XMLATTRIBUTES

    April 3, 2017 Michael Sansoterra

    Hey, Mike:

    After reading the IT Jungle Guru tips on DB2 XML Composition (see Related Stories below), I’ve been able to build XML from relational data. I have everything working but now I need to enclose all data in a “Document” tag after the XML declaration like the example here:

    <?xml version="1.0" encoding="utf-8"?>
    <Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://MyCompany.com" 
    xsi:schemaLocation="http://MyCompany.com validate.xsd">
    

    I tried using XMLNAMESPACES but can’t get it to produce the “xsi:schemaLocation” tag. How can I construct the document tag I need?

    –N.C.

     

    The problem here is that the xsi:schemaLocation in your example is not a namespace, but …

    Read more
  • Guru: Sorting Options For CPYTOIMPF

    March 27, 2017 Ted Holt

    I hope that whoever came up with the idea for the Copy to Import File (CPYTOIMPF) command was well compensated. When I think of the time and effort that that command has saved me and countless others, I feel deep gratitude. The addition of the ORDERBY parameter increased the usefulness of CPYTOIMPF, and I’d like to share that with you.

    CPYTOIMPF copies a single-format database file (table, physical file, view, or logical file) to a stream file or physical file in a format that is acceptable to another system or application. Probably the most common use of this command is …

    Read more
  • Conditional SQL I/O, Take 2

    March 20, 2017 Ted Holt

    Bob writes, “Hey, Ted! I hope you can teach an old dog a new trick. I am trying to replace the CHAIN operation with SQL. I chain once to a file to read a certain record. If that record is not found, I chain again to retrieve a default record. How can I make SQL do a second read to the same file?”

    This is not a hard thing to do, as SQL has no problem joining more than once to the same table. I’ll show you two methods to retrieve your data. The first method is the easier one, …

    Read more
  • Guru: MiWorkplace As An Alternative To SEU

    March 13, 2017 Jon Paris

    From time to time somebody will recommend an application to me and it sounds really useful – until I discover that it is Windows Only. Whenever that happens I usually go to one of the Alternative To websites, such as AlternativeTo.net, to see what I can find.

    Recently I was asked if there were any alternatives to SEU by a programmer who wanted to use fully free RPG and was tired of the green screen blobs all over his code. (See the example below if you don’t know what I mean by this.) This was a topic that …

    Read more
  • Guru: The PHP Path To Victory, Part 1

    March 6, 2017 Chris Ringer

    If you read my two previous PHP articles, you may be tempted to make the leap to use PHP on your IBM i. But you may also have reservations because how in the world will you technically support those apps post implementation?

    This article discusses the path a PHP request takes as it travels through various subsystems up to your RPG code and how to do basic troubleshooting if something goes wrong.

    Tag Team Match

    Often greatness is achieved with the help of someone else. Michael Jordan had Scottie Pippen. Babe Ruth had Lou Gehrig. And Abbott had Costello. In …

    Read more
  • Guru: Eliminate The Legitimate Use Of GOTO, Take Two

    February 27, 2017 Ted Holt

    I was annoyed that IBM chose not to support GOTO and TAG in free-form RPG calculations. I rarely used those opcodes, but when I did, it was in disciplined situations when nothing else would do. Besides, I didn’t want to be treated like a baby. Now it’s a non-issue. IBM finally provided an alternative to the last legitimate use of GOTO.

    Almost five years ago, I wrote about a situation that I come across from time to time, namely the need to execute a clean-up routine before exiting an RPG subprocedure. Since nothing forbids a subprocedure to have multiple …

    Read more

Next Articles

Content archive

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

Recent Posts

  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20
  • 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

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