• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Prompting CL in Run SQL Scripts

    December 9, 2009 Skip Marchesani

    System i Navigator’s Run SQL Scripts lets you create scripts, from simple to complex, that can be comprised of one to many SQL statements and/or batch CL commands (no interactive or display commands allowed). SQL statements are entered without any prefix, and batch CL commands must be prefaced with CL.

    The syntax for SQL statements and batch CL commands can get quite complex, and keying or creating each without some sort of help or assistance can be a challenge. RUN SQL Scripts does a good job of helping you create either.

    Figure 1.

    There is SQL Assist for SQL statements and CL Prompt for batch CL commands. Both are accessed the same way, and since the focus of this article is prompting CL commands, the CRTLIB command will be used as our example as shown in Figure 1.

    Place the cursor on or within the batch CL command you wish to prompt. Next click Edit on the left side of the toolbar, and then SQL Assist/Prompt CL as shown in Figure 2, or just press F4 while the cursor is on or within the CRTLIB command.

    Figure 2.

    After clicking on SQL Assist/CL Prompt or pressing F4, you will see the Create Library panel shown in Figure 3. A quick examination and comparison will show that this Create Library panel is the graphical equivalent of the basic green screen prompt for the CRTLIB command.

    Figure 3.

    If you click on View on the left side of the toolbar for the Create Library panel as shown in Figure 4, you will also find that the same command key functions exist for this graphical CL prompting as for the Green Screen prompting seen in Figure 5.

    Figure 4.

    Figure 5.

    The function key titles may differ–Advanced vs. Additional Parameters for F10, and Reset vs. Refresh for F5–but the function remains the same.

    Figures 6 and 7 illustrate the results of pressing F10 to see advanced or additional parameters.

    Figure 6.

    Figure 7.

    Figures 8 and 9 show the result of pressing F11 to see keywords.

    Figure 8.

    Figure 9.

    To complete prompting of the command, key in the required and optional (if any) parameters and then click the OK button at the bottom of the Create Library panel as shown in Figure 10.

    Figure 10.

    The completed command string will then be returned in the Run SQL Scripts panel as shown in Figure 11.

    Figure 11.

    Take note that there is no support for menu based prompting to see a group of related commands, such as is available with the GO CMDxxx (GO CMDCRT) command.

    As previously stated, only batch commands are allowed in scripts. Interactive commands such as DSPxxx (DSPLIB, for example) are not allowed.

    To prompt a batch CL command, the cursor must be on or within the textual context of the command. If the cursor is not, Run SQL Scripts assumes you want to create an SQL statement and brings up SQL Assist.

    Skip Marchesani retired from IBM after 30 years and is now a consultant with Custom Systems Corporation. He is also a founding partner of System i Developer and the RPG & DB2 Summit. Skip spent much of his IBM career working with the Rochester Development Lab on projects for S/38 and AS/400 and was involved with the development of the AS/400. He was part of the team that taught early AS/400 education to customers and IBM lab sites worldwide. Skip is recognized as an industry expert on DB2 for i and the author of the book DB2/400: The New AS/400 Database. He specializes in providing customized education for any area of the System i, iSeries, and AS/400; does database design and design reviews; and performs general System i, iSeries, and AS/400 consulting for interested clients. He has been a speaker for user groups, technical conferences, and System i, iSeries, and AS/400 audiences around the world. He is an award-winning COMMON speaker and has received its Distinguished Service Award. Send your questions or comments for Skip to Ted Holt via the IT Jungle Contact page.

    RELATED STORIES

    Retrieving and Storing SQL Source for DB2 Database Objects

    V6R1 Run SQL Scripts: Saving Scripts to a System i Source File

    Configuring Run SQL Scripts for Ad Hoc Queries

    Changing the Library List for Run SQL Scripts

    Visual Explain for Run SQL Scripts

    Displaying Multiple Results Sets in Run SQL Scripts

    SQL Assist: Powerful Interactive SQL

    V6R1 Enhancements for Run SQL Scripts



                         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
    New Generation Software

    FREE Webinar:

    Creating Great Data for Enterprise AI

    Enterprise AI relies on many data sources and types, but every AI project needs a data quality, governance, and security plan.

    Wherever and however you want to analyze your data, adopting modern ETL and BI software like NGS-IQ is a great way to support your effort.

    Webinar: June 26, 2025

    RSVP today.

    www.ngsi.com – 800-824-1220

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    ARCAD Software:  December 17 Webinar - Make Testing Simple: accelerate audit compliance
    PowerTech:  Get your FREE System i Compliance Assessment today!
    Manta Technologies:  Year-End SALE! 40% off the complete library and all combo packs. Ends Jan 15

    IT Jungle Store Top Book Picks

    Easy Steps to Internet Programming for AS/400, iSeries, and System i: List Price, $49.95
    The iSeries Express Web Implementer's Guide: List Price, $49.95
    The System i RPG & RPG IV Tutorial and Lab Exercises: List Price, $59.95
    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket SQL Guide: List Price, $59.00
    The iSeries Pocket Query Guide: List Price, $49.00
    The iSeries Pocket WebFacing Primer: List Price, $39.00
    Migrating to WebSphere Express for iSeries: List Price, $49.00
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    Chip Wars: List Price, $29.95

    iMessaging Integrates i OS Application with Nortel Call Center Software Power Systems i: Serve’s Up

    Leave a Reply Cancel reply

Volume 9, Number 38 -- December 9, 2009
THIS ISSUE SPONSORED BY:

Profound Logic Software
WorksRight Software
VAULT400

Table of Contents

  • Prompting CL in Run SQL Scripts
  • Publish Result Sets Using Web Services and IWS
  • Admin Alert: The Ins and Outs of IBM Business Partners
  • Getting the Message, Part 2
  • Passing an Entire Result Set as a Parameter, Part 2
  • Setting Up SNTP Time Synchronization on an i5/OS Box

Content archive

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

Recent Posts

  • Big Blue Raises IBM i License Transfer Fees, Other Prices
  • Keep The IBM i Youth Movement Going With More Training, Better Tools
  • Remain Begins Migrating DevOps Tools To VS Code
  • IBM Readies LTO-10 Tape Drives And Libraries
  • IBM i PTF Guide, Volume 27, Number 23
  • SEU’s Fate, An IBM i V8, And The Odds Of A Power13
  • Tandberg Bankruptcy Leaves A Hole In IBM Power Storage
  • RPG Code Generation And The Agentic Future Of IBM i
  • A Bunch Of IBM i-Power Systems Things To Be Aware Of
  • IBM i PTF Guide, Volume 27, Numbers 21 And 22

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