• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • RPG And The BLOB

    December 13, 2016 Hey, Mike

    I’m trying to use a SELECT/INTO embedded SQL statement in an RPG program that accesses a table that includes a BLOB(20K) column. The INTO target is an externally defined data structure based on the table. However, I get compiler errors unless I remove the BLOB column from the table. What’s up with that?

    —Four Hundred Guru reader

    The problem is that RPG doesn’t have a native data type equivalent of a BLOB (or the other large object types CLOB/DBCLOB, for that matter.) The reason for this is that large object types can be up to 2GB in size, far

    …

    Read more
  • How Do You Do That with RDi? Part 2: Compile

    December 13, 2016 Susan Gantner

    In an earlier tip, I began a series on how I do things using RDi that some people seem to prefer doing in PDM. In that first tip, I talked about various ways to copy a source member. In this tip, I’ll talk about compiling with RDi.

    I must confess to being baffled by the number of people I talk to who, while they do all their editing in RDi, always go back to PDM to do their compiles. To me, if you don’t compile your code with RDi, you’re missing out on a huge time-saver: the ability to

    …

    Read more
  • Fundamentals: Parameter Passing

    November 29, 2016 Jon Paris

    Even though high-level languages make it unnecessary–and in many cases, difficult–to understand what is going on “under the covers,” I have always found a basic knowledge of internal processes to be invaluable. This is particularly true when it comes to resolving mystery bugs. I was reminded of this recently by a number of problems related to parameter passing that appeared on Internet lists and also in my email directly from customers.

    My need to understand internals is due, at least in part, to the fact that I learned assembler and other low-level languages at an early stage in my career.

    …

    Read more
  • Odds and Ends

    November 29, 2016 Hey, Gurus!

    The end of the year is upon us and the holidays are fast approaching. That sounds like a good excuse for some odds and ends. I hope you find something helpful here.–Ted


    Hey, Ted:

    I’m writing in response to Michael Sansoterra’s article, Native Regular Expressions In DB2 For i 7.1 And 7.2. I don’t use regular expressions much, but our C# development team does. Here’s a regular expression that I find to be of help.

    // count the slashes in the URL
    Dcl-S Count     Packed(4);
    
    Exec sql
       set :Count = REGEXP_COUNT('/qibm/ProdData/Java400/bin/JavaDoc','/') ;
    

    –Steve

    Three decades or so ago, when

    …

    Read more
  • One Way To Condense A Verbose Spooled File

    November 29, 2016 Ted Holt

    IBM i includes many reports that we can use to glean a lot of information. If you run packaged software, the vendor likely includes many other reports. The problem with such reports is that they often contain more information than what you need and want. After all, they’re written for the world at large, not tailored for you. It may be that a utility that resides on your system can transform reports into something more suitable for you and those who use your system.

    First, let’s get a report.

    DSPLNK OUTPUT(*PRINT) DETAIL(*EXTENDED) DSPOPT(*USER)
    

    Running this command on one of the

    …

    Read more
  • Calling SQL Functions From RPG, A Service Program

    November 15, 2016 Paul Tuohy

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

    In this article I would like to introduce a service program that provides RPG subprocedure “wrappers” for using SQL scalar functions. This means you can use an SQL scalar function as if it were an RPG built-in function.

    Using an SQL scalar function can be a lot easier than using the RPG alternative:

    • Use the UPPER function instead of defining two translation strings and using %XLATE.
    • Use DAYNAME function instead of calculating the day of the week and using an array to provide the day name.
    • Using the
    …

    Read more
  • SQL PL–The LOOP Loop

    November 15, 2016 Ted Holt

    In the previous episode of this exciting series, I wrote about FOR, arguably the most useful of the SQL PL looping structures. Next in line of usefulness, in my opinion, is the LOOP structure. Like the rest of SQL PL, this is an easy structure to master, and I am pleased to write about it.

    In its simplest form, the syntax of the LOOP structure is as follows:

    LOOP - body - END LOOP
    

    Here is a more realistic version of the syntax:

    label: LOOP - body - END LOOP label
    

    The body contains any assortment of simple statements

    …

    Read more
  • QTEMP Is A Different Animal

    November 15, 2016 Hey, Ted

    I have a problem with an FTP script. I wish to send a file in QTEMP to a remote system, but the script tries to send the file from QGPL instead. The PUT command does not tell which library to send the file from because our standards prohibit the use of hard-coded library names. Any thoughts will be appreciated.

    –Al

    I commend you and other wise people in your shop for outlawing the hard-coding of library names, Al. The library list is a wonderful feature of IBM i, a feature that is sorely missing from other database systems. I have

    …

    Read more
  • IBM i Access Client Solutions For Database

    November 1, 2016 Paul Tuohy

    If you are an SQL user, you need to get your hands on IBM i Access Client Solutions. After some false starts, it looks as if IBM is heading in the right direction again when it comes to providing tools to help us develop and use SQL. I want to take you through some of the highlights of the database functions of IBM i Access Client Solutions.

    Some Background

    Over the last few years, trying to find the right tools for the SQL developer has been quite a challenge. There were Run SQL Scripts in System i Navigator, the

    …

    Read more
  • SQL PL–The FOR Loop

    November 1, 2016 Ted Holt

    SQL PL has four looping structures. The most useful one, to my way of thinking, is the FOR structure. It is different from–and more powerful than–the RPG FOR op code, and it’s easy to learn and use. Here’s how it works.

    FOR iterates over a read-only result set and terminates when there are no more rows to process. Think of a FOR loop as a read-only cursor without the messiness of OPEN, FETCH, and CLOSE. Let me illustrate with a stored procedure.

    create or replace Procedure Billing (in p_BillingCycle dec(3))
    for One_Customer as
       select c.AccountNumber
         from customers as c 
        where 
    …

    Read more

Previous Articles

Content archive

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

Recent Posts

  • IBM Tweaks Some Power Systems Prices Down, Others Up
  • Disaster Recovery: From OS/400 V5R3 To IBM i 7.4 In 36 Hours
  • The Disconnect In Modernization Planning And Execution
  • Superior Support: One Of The Reasons You Pay The Power Systems Premium
  • IBM i PTF Guide, Volume 25, Number 13
  • IBM i Has a Future ‘If Kept Up To Date,’ IDC Says
  • When You Need Us, We Are Ready To Do Grunt Work
  • Generative AI: Coming to an ERP Near You
  • Four Hundred Monitor, March 22
  • IBM i PTF Guide, Volume 25, Number 12

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 © 2023 IT Jungle