fhg
Volume 9, Number 38 -- December 9, 2009

Prompting CL in Run SQL Scripts

Published: December 9, 2009

by 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


Sponsored By
PROFOUND LOGIC SOFTWARE

Learn the Modernization Tactics
you need to be successful.

Watch our latest on-demand webinar and
learn about the various methods for
modernization and how you can integrate
them to find the right mix for
your business.

Plus, see several real-life examples of how
these modernization methods can
work together.

Download this educational webinar today.


Senior Technical Editor: Ted Holt
Technical Editor: Joe Hertvik
Contributing Technical Editors: Erwin Earley, Brian Kelly, Michael Sansoterra
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.

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


 
The Four Hundred
Power Systems i: Thinking Inside the Box

Higher ASPs Help the Server Racket Perk Up a Little

Smart Market ISVs Find Few Leads in Early Going

As I See It: Al and Me

Vision Sees Positive Trends for HA/DR in Second 'State of Resilience' Report

Four Hundred Stuff
Fiserv 2.0 Banks on the Reliability of Power Systems

Quadrant Eases Installation, Lowers Price on IntelliChief

TMW Systems Buys Innovative Computing, Including 300 i OS Customers

Databorough Unveils 'Lite' Version of Application Analysis Tool

10ZiG Acquires BOSaNOVA System i Connectivity Products

Four Hundred Monitor
Four Hundred Monitor's
Full iSeries Events Calendar

System i PTF Guide
November 28, 2009: Volume 11, Number 48

November 21, 2009: Volume 11, Number 47

November 14, 2009: Volume 11, Number 46

November 7, 2009: Volume 11, Number 45

October 31, 2009: Volume 11, Number 44

October 24, 2009: Volume 11, Number 43

October 17, 2009: Volume 11, Number 42

TPM at The Register
Red Hat revs real-time MRG Linux to 1.2

IBM thinks outside the box with containerized data centres

Novell to mashup management tools

Stealth: Dell's other server business

Midrange, big iron take the Q3 hits

Concurrent unhoods RedHawk Linux 5.4

rPath heaves Javelin at Red Hat

Sun VirtualBox gets live migration

Server sales stabilizing, says study

Fujitsu gung-ho on eight-core 'Venus' Sparc

IBM shows off Power7 HPC monster

Super Micro primes 'Magny-Cours' Opterons

THIS ISSUE SPONSORED BY:

Profound Logic Software
WorksRight Software
VAULT400


Printer Friendly Version


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

Four Hundred Guru

BACK ISSUES




 
Subscription Information:
You can unsubscribe, change your email address, or sign up for any of IT Jungle's free e-newsletters through our Web site at http://www.itjungle.com/sub/subscribe.html.

Copyright © 1996-2009 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc., 50 Park Terrace East, Suite 8F, New York, NY 10034

Privacy Statement