• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Interpreted CL Members

    March 7, 2012 Hey, Ted

    I am thinking of writing a program that will read a source member of CL commands, interpreting them and running them dynamically one at a time. I can think of several situations in which such a utility would be more suitable than compiled CL programs. Before I re-invent the wheel, I want to know if IBM i already has something like that.

    –Tom

    Yes, there’s something like that. You can do this sort of thing with input spooling. I’ve only used input spooling on occasion, so I’m not an expert, but I can show you how it works.

    Create a source physical file member to hold the CL commands. Place Batch Job (//BCHJOB) and End Batch Job (//ENDBCHJOB) commands in the first and last records, with your commands in between, like this:

    //BCHJOB   JOB(MYJOB) JOBQ(NOMAX)
    DSPLIBL    OUTPUT(*PRINT)
    DSPLIB     LIB(MYLIB) OUTPUT(*PRINT)
    //ENDBCHJOB
    

    Use the Submit Database Job (SBMDBJOB) to run the commands in the file.

    SBMDBJOB FILE(MYLIB/MYSRCF) MBR(MYSRCMBR)
    

    One thing you should be aware of is that most of the parameters that you’re accustomed to placing in the Submit Job (SBMJOB) command don’t appear in SBMDBJOB, but in BCHJOB instead.

    In addition to CL commands, the file may contain input data for the job stream. Tell the program to read a file named QINLINE. Here’s such a program, which I call MYRPGPGM.

    Fqinline   ip   f   80        disk
    Fqsysprt   o    f  132        printer
    D count           s              3p 0
    Iqinline   ns  01
    I                                  1   80  DataIn
     /free
         count += 1;
     /end-free
    Oqsysprt   h    1p                  1
    O                                              'Begin'
    O          d    01                  1
    O                       count         4
    O                       DataIn           +   1
    O          t    lr                  1
    O                                              'End'
    

    Surround the data with //DATA and an end-of-data marker, which defaults to //.

    //BCHJOB   JOB(MYJOB) JOBQ(NOMAX)
    CALL MYRPGPGM
    //DATA
    LINE 1
    LINE 2
    LINE 3 AND FINAL
    //
    //ENDBCHJOB
    

    As I said, I’ve rarely used input spooling. I suspect that’s true in general. When I was new to the System/38 world (having worked only with S/34 and S/36), I asked an experienced S/38 programmer how he submitted batch jobs, and he replied, “SBMJOB. Is there any other way?”



                         Post this story to del.icio.us
                   Post this story to Digg
        Post this story to Slashdot

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    BCD:  On-Demand Webinar with Bob Cozzi: 5 decision to make before a Web enablement project
    System i Developer:  Upgrade your skills at the RPG & DB2 Summit in Fort Worth, March 26-28
    COMMON:  Join us at the 2012 Conference & Expo, May 6 - 9 in Anaheim, CA

    IT Jungle Store Top Book Picks

    BACK IN STOCK: Easy Steps to Internet Programming for System i: List Price, $49.95

    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The iSeries Pocket Database Guide: List Price, $59
    The iSeries Pocket SQL Guide: List Price, $59
    The iSeries Pocket WebFacing Primer: List Price, $39
    Migrating to WebSphere Express for iSeries: List Price, $49
    Getting Started with WebSphere Express for iSeries: List Price, $49
    The All-Everything Operating System: List Price, $35
    The Best Joomla! Tutorial Ever!: List Price, $19.95

    Reader Feedback On Thinking Strategically About IT As A Service IBM Does March Madness Rebate On Power 770s

    Leave a Reply Cancel reply

Volume 12, Number 5 -- March 7, 2012
THIS ISSUE SPONSORED BY:

WorksRight Software
Infor
Northeast User Groups Conference

Table of Contents

  • Commenting Interactive Code
  • Interpreted CL Members
  • Admin Alert: Getting Started With An i 6.1 Upgrade

Content archive

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

Recent Posts

  • The Power11 Transistor Count Discrepancies Explained – Sort Of
  • Is Your IBM i HA/DR Actually Tested – Or Just Installed?
  • Big Blue Delivers IBM i Customer Requests In ACS Update
  • New DbToo SDK Hooks RPG And Db2 For i To External Services
  • IBM i PTF Guide, Volume 27, Number 33
  • Tool Aims To Streamline Git Integration For Old School IBM i Devs
  • IBM To Add Full System Replication And FlashCopy To PowerHA
  • Guru: Decoding Base64 ASCII
  • The Price Tweaking Continues For Power Systems
  • IBM i PTF Guide, Volume 27, Numbers 31 And 32

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