• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Parameterized RUNSQLSTM

    June 21, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Can I pass parameters to an SQL statement in a source member before executing the Run SQL Statement (RUNSQLSTM) command? I’m sure there must be a simple way, but I’ve never seen any examples of this.

    For example, today I might like to have the SQL statement select company 005. Tomorrow I might want it to select company 007.

    — Darrell

    What you want is the ability to put placeholders in the SQL source and specify replacement arguments on the RUNSQLSTM command, as you can do with the Start Query Management Query (STRQMQRY) command.

    It may be worth

    …

    Read more
  • String Parameters of Various Lengths

    June 19, 2002 Timothy Prickett Morgan

    Hey, Ted:

    In the May 29 issue of Midrange Guru, OS/400 Edition, you describe a method for passing string parameters of variable length to a subprocedure. This possibility has some risks.

    The subprocedure must guarantee that it only changes the data passed to it by the caller.

    For example, suppose a parameter field in the called program or procedure is defined with a length of 15 bytes. A calling procedure passes five bytes. The API CEEDOD determines a length of five bytes, which is correct, but the length of the parameter field is however unchanged. If contents of the

    …

    Read more
  • Tracing a Qshell Variable

    June 19, 2002 Timothy Prickett Morgan

    Hey, Ted:

    A variable is getting changed in a Qshell script, but I can’t determine where it’s happening. How can I track changes to a variable?

    — Len

    Add the following lines to the top of the script:

    trap 'echo "DBG: $var = "$var""' DEBUG
    set -x 
    

    The trap command with the DEBUG condition executes the command between single quotes (‘) after each simple command of the script runs. In this case, Qshell echoes the value of a variable named var to the display. Replace var with the name of your variable.

    The set command with -x option causes Qshell

    …

    Read more
  • LAYOUT: An Improved DSPFFD

    June 19, 2002 Timothy Prickett Morgan

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

    The article was revised on 12/22/14.

    Dear Readers:

    Tim Swearingen recently sent me a copy of his LAYOUT utility. It shows records layouts, as does the Display File Field Description (DSPFFD) command, but in a nicer format, and it also includes access path information. I liked it and thought some of you might find it helpful too.

    The utility consists of four objects:

    • a command object called LAYOUT

    • a printer file called LAYOUTP

    • a CL program called LAYOUTC

    • an RPG III (RPG/400) program called LAYOUTR

    Place the source

    …

    Read more
  • Reader Feedback and Insights: Group Job Limitation

    June 14, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I’m writing in response to the first tip that appears in the “Odds and Ends” column, May 17, 2002, Midrange Guru, OS/400 Edition.

    I’ve always understood that when you transfer to a group job, the job that you leave doesn’t continue running, but it stops until you return to it. Am I correct? If so, you should tell your readers about this limitation.

    — Fernando

    Yes, Fernando. You are correct. Only one group job runs at a time.

    — Ted

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    SEQUEL meets all your iSeries and AS/400 data access needs in

    …

    Read more
  • String Parameters of Various Lengths, Take Three

    June 14, 2002 Timothy Prickett Morgan

    Hey, Ted:

    The May 29 Midrange Guru, OS/400 Edition, article, “String Parameters of Various Lengths,” is a great explanation of the CEEDOD API, but I don’t see the point in using the technique in this context. A simple variable-length field used as the parameter is far more flexible and avoids the overhead of operational descriptors

    and the extra API call. Use of the CONST keyword allows you to pass fields of different lengths and non-varying-length fields as parameters, and you can use the %LEN function in the subprocedure to find the length of the string field. Am I missing

    …

    Read more
  • Searching Message Text

    June 14, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Is there a way to print or query a message file?

    My problem is that I know the message text and need to find the message ID.

    — Bill

    Use the Display Message Description (DSPMSGD) command to build a spool file:

    DSPMSGD RANGE(*FIRST *LAST) MSGF(xxx) +
       DETAIL(*BASIC) OUTPUT(*PRINT)
    

    Then display the spool file and search it.

    — Ted

    Sponsored By
    TRAMENCO

    SEQUEL meets all your iSeries and AS/400 data access needs in a single, integrated solution:

    • Windows, Web or host user interfaces
    • Convert AS/400 data into PC file formats
    • E-mail or FTP query results, reports and spool files
    …

    Read more
  • Reader Feedback and Insights: Printing Leading Zeros in Query/400, Another Look

    June 12, 2002 Timothy Prickett Morgan

    Hey, Ted:

    In response to your “Odds and Ends” article in the May 31 Midrange Guru, OS/400 Edition, specifically the tip that discusses Printing Leading Zeros in Query/400, Another Look, there’s another way to ‘skin a cat.’

    Use an edit word with an extra zero at the beginning of the field. For example, to edit a Social Security number, I use edit word 0nnn-nn-nnnn. It works just fine unless you need to print this field starting at print position 1.

    — Rich

    Sponsored By
    ADVANCED SYSTEMS CONCEPTS

    SEQUEL meets all your iSeries and AS/400 data access

    …

    Read more
  • String Parameters of Various Lengths, Take Two

    June 12, 2002 Timothy Prickett Morgan

    Dear Readers:

    Several people have written to point out errors in my solution to the reader who wanted to make an RPG subprocedure accept character parameters of any size. I need to correct the code that I provided in that issue of Midrange Guru, OS/400 Edition. (I plan to explore this topic more and to present the ideas of my respondents in the near future, so watch for more information in a future edition of Midrange Guru.)

    Here is the original question”

    “I have an RPG IV subprocedure that I call from several different programs. I use

    …

    Read more
  • Build SQL to Define Your Existing Files, Revisited

    June 12, 2002 Timothy Prickett Morgan

    Hey, Ted:

    In the June 5 issue of Midrange Guru, OS/400 Edition, you explained how to use the QSQGNDDL API to generate SQL to create SQL Data Definition Language (SQL DDL) for existing objects. I’m writing to mention that you can do the same thing without any programming through Operations Navigator (OpsNav).

    — John Valance

    Thanks for bringing it up, John.
    Here are the steps:

    When you open the connection to the iSeries machine, you’ll see a Database option in the navigation pane. When you click on Database, the tasks panel (across the bottom of the window) will be

    …

    Read more

Previous Articles Next Articles

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