• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Retrieving Data From All Members With SQL

    March 1, 2016 Michael Sansoterra

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

    Everyone knows that DB2 for i SQL doesn’t play well with legacy multi-member database files. The CREATE ALIAS statement allows SQL to access a particular member of a file. But what if you want to access all members in a file using SQL as though they were a single member? A reader recently inquired about this topic and further wanted to know if there was a built-in SQL function to return each row’s member name.

    NOTE: For clarification, I’m not discussing members of a DB2 partitioned table.

    Here

    …

    Read more
  • Easy Printing From CL

    March 1, 2016 Ted Holt

    CL cannot write to printer files. This is understandable, since CL fits into the category of job control languages. Even though I’d never use CL to build an aged receivables report, there are times when it is advantageous for a CL program to generate a report (i.e., produce a spooled file), and here are two fairly easy ways to do that.

    Suppose you have a CL program that runs three RPG programs in nightly batch processing. There are people in your organization who need to know whether these programs ran successfully or not. If you could build a short spooled

    …

    Read more
  • The Three Sources Of RUNSQLSTM

    March 1, 2016 Ted Holt

    The Run SQL Statements (RUNSQLSTM) command executes a file of SQL and/or CL commands. If you’ve used this command, you probably know that RUNSQLSTM reads the commands from a source physical file member. But did you know that there are two other places from which it can read SQL commands?

    First, the usual way. Here’s member LOADPLANTS in source physical file SCRIPTS.

    CREATE TABLE PLANTS (ID DEC(3), LOCATION VARCHAR(24),
       PRIMARY KEY (ID));
    INSERT INTO PLANTS VALUES
    (  1,  'Lost Angeles'),
    (  2,  'New Yolk'),
    (  3,  'Waste Virginia');
    

    To create the PLANTS table and initialize it with data, do this:

    …

    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