• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Reader Feedback and Insights: Splitting a Qshell Variable

    August 30, 2002 Timothy Prickett Morgan

    Hey, Ted:

    The tech tip for splitting a Qshell variable is certainly one way to do it, but it seems to me a roundabout approach.

    My first thought would be to use the “split” command in awk, but awk does not seem to be a supported language in Qshell.

    Instead, I would use the “cut” command, which is supplied along with Qshell. Something like this example:

    first=$(echo $name | cut -d " " -f 1)
    last=$(echo $name | cut -d " " -f 2)
    

    We have to pipe the variable into the “cut” command because cut normally works on standard input or files. We have to specify the delimiter with the “-d” option if it isn’t the default, which is a tab character. The “-f ” specifies which field we want.

    Note that the “cut” command also allows the chopping up of any line into fields based on absolute position.

    The point of all this is “The Unix Way”–Multiple small utilities that can be rapidly strung together to get what you want.

    — Tom Henderson

    Thanks for sharing this technique, Tom. I played with it some more and found a simpler version of the technique I originally presented.

    set $name
    first=$1
    last=$2
    

    It seems like any way you do it, it is a roundabout approach.

    — Ted

    Sponsored By
    WORTH CONSULTING

    Improve Legacy Programs with Super/Windows

    Summary:

    This newly released tool for the iSeries is used to improve user and programmer productivity and efficiency.

    Pop-up windows (or selection windows) are what users want to make their jobs easier and more accurate. They have been exposed to “list boxes” when on the Internet or when using a typical windows-based program. This feature makes it so that the user does not need those sticky notes and reference material at their grasp to know what value to key in entry fields.

    Programmers have been reluctant to put the selection window feature in entry programs because it takes substantial programming efforts to build the information and display it on the screen. It also requires major additions to the display files.

    Super/Windows easily enables pop-up selection windows to your application programs in an affordable manner. Very few changes are required to be made to your existing RPG, COBOL, and CL programs. Changes to your display files are not needed! Your existing code or table files are used to populate the information in the windows from which your users make selection. You can also use the codes file (and maintenance program) that is included with Super/Windows. One of Super/Windows’ functions generates the program source for each file ID using a simple entry program where the file and descriptive information is recorded. The source can be modified to return additional fields.

    You do not have to make wholesale changes to your application software, can optimize your staff’s existing skills, and little user training is needed. They will welcome Super/Windows with open arms!

    Business Owner Benefits:

    • Low Investment / High ROI as compared to leading high investment solutions that generate application software.
    • Immediate observable results.
    • Efficiency in workforce.
    • Faster training of users and programmers by using existing skill sets.
    • Gradual implementation with control of the degree of application.
    • its your budget: no increase in personnel and no major software expense.
    • License fee is $1,500 for first system and $750 for each subsequent system, no matter how many users or system size!
    • Annual maintenance is $300, regardless of the number of installations.

    Programmer Benefits:

    • Installs in 5 minutes. Free 30-day trial.
    • Values in windows are built from your existing code and table file…nothing is “hard-coded.”
    • The programs that retrieve the data for display are automatically generated after entry of file and key information.
    • Easily implemented. Only two copybook lines and 8 lines for each field to be enabled are added to each program.
    • No changes to display files are needed, so programs can be promoted when currently active.
    • Code validation routines and file definitions for the enabled codes are no longer needed in your programs.
    • New programs to allow users to input criteria for reports and extracts are a snap!
    • Examples in RPG, RPGLE, COBOL, and CLP are provided.
    • The system can also be used in batch environment to retrieve descriptive values to be included in reports and extract files.

    User Benefits:

    • Improved accuracy. Invalid keyed entry causes window to pop up allowing the user to select a valid entry.
    • Reliance on printed code lists and manuals is reduced.
    • Improved efficiency. Eyes remain on the screen and keyboard with no need to access the mouse to cause a list box to appear.
    • Selected values are always up to date from the code or table files.
    • Improved customer service as entries can be selected with customer consent when in phone contact.

    Click here to learn more about Super/Windows.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags: Tags: mgo_rc, Volume 2, Number 66 -- August 30, 2002

    Sponsored by
    Midrange Dynamics North America

    With MDRapid, you can drastically reduce application downtime from hours to minutes. Deploying database changes quickly, even for multi-million and multi-billion record files, MDRapid is easy to integrate into day-to-day operations, allowing change and innovation to be continuous while reducing major business risks.

    Learn more.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Edit with Parentheses in Query/400 Reader Feedback and Insights: Odds and Ends Always Popular

    Leave a Reply Cancel reply

MGO Volume: 2 Issue: 66

This Issue Sponsored By

    Table of Contents

    • Reader Feedback and Insights: Splitting a Qshell Variable
    • Adding Subprocedures to a Service Program
    • A Fuzzy Search Algorithm

    Content archive

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

    Recent Posts

    • Meet The Next Gen Of IBMers Helping To Build IBM i
    • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
    • Will Independent IBM i Clouds Survive PowerVS?
    • Now, IBM Is Jacking Up Hardware Maintenance Prices
    • IBM i PTF Guide, Volume 27, Number 24
    • 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

    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