• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Get Rid of Old IFS Files, Take Two

    December 6, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have worked with Unix for 18 years. Here is a Qshell command that will remove any file that is more than seven-days old. (It also checks subdirectories).

    Here is the command:

    find * -type f -mtime +7 -exec rm {} ;
    

    — Mike

    I am grateful to Mike for providing that tip.

    Now, let’s break that command down so we can understand it.

    The find command locates files that match certain criteria. In this case, find looks for files that have not been modified in the last seven days.

    The find command may be followed by options.

    …

    Read more
  • Performance of the SQL LIKE Predicate

    December 6, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I have heard that SQL’s LIKE predicate cannot take advantage of indexes. Can I use indexes to speed up a query that uses LIKE?

    — Jim

    LIKE has long had the reputation of being a poor performer, probably because of the way it has been implemented on various platforms. In some cases, using LIKE in a query guarantees a database scan (e.g., reading the entire table).

    If the expression begins with a wildcard character–an underscore ( _ ) to represent a single character, a percent sign (%) to represent multiple characters–then the query will require a database scan

    …

    Read more
  • Reader Feedback and Insights: RPG II

    December 4, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I am writing in response to your article, “Help with RPG II Programs“, which published in the November 1 issue of Midrange Guru, where you explained replacing indicators in S/36 RPG code. You provided some good suggestions about indicator replacement in S/36 code. Since I’m still ‘hip boots and snorkel deep’ in that code, I have a few more suggestions.

    Definitely investigate the replacement of calculation result indicators with the “IFEQ” calculation operations.

    If it appears that you still need to retain an indicator for conditioning output, investigate including an EXCPT op code within the

    …

    Read more
  • Protecting HTML Page Elements with JavaScript and CSS

    December 4, 2002 Timothy Prickett Morgan

    Hey, David:

    I have an HTML form with several optional elements. Is there a way to protect and unprotect text elements based on a checkbox? When the user checks an alternate shipping address box, I want to open up a set of shipping address fields. I tried to do this with JavaScript, but the value of the checkbox doesn’t seem to change in Internet Explorer.

    — Loren

    You were on the right track checking the value for the checkbox; however checkboxes are a special case.

    The value attribute for checkboxes represents what the browser sends to the server when the

    …

    Read more
  • LIKE is Like, Confusing, Man!

    December 4, 2002 Timothy Prickett Morgan

    Hey, Ted:

    IBM is doing it again, and I’m about to pop a vein. I’m getting a data decimal error in an RPG IV program when I access the contents of a data area subfield. The subfield is called PPLANT and it’s defined on the D spec with the LIKE keyword. PPLANT is based on a database file field named IPLANT, which is zoned.

    D PlantDS         ds
    D  PPlant                             like(iplant)
    

    The compiler listing shows IPLANT in the file input and output buffers as being in zoned-decimal format. However, the cross reference shows IPLANT as being in packed-decimal format. Since IPLANT

    …

    Read more
  • Reader Feedback and Insights: Thanks for Qshell Tips

    November 20, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I just wanted to drop you a note of thanks for the QShell tips you’ve shared in the Guild Companies publications, Midrange Guru and Midrange Programmer. One of my clients had a PC text file of information but just wanted from it a printed list of the part numbers. Since the majority of ISBNs begin with 0 or 1, I came up with the following solution (based on the great tips from you) using QShell:

    touch -C 819 isbnlist.txt
    grep ^[01] cat_prb.txt >isbnlist.txt
    

    That produced a nice ASCII list of files in the Integrated File System (IFS),

    …

    Read more
  • V5R1 Storage Model Mismatch

    November 20, 2002 Timothy Prickett Morgan

    Hey, Ted:

    I made a small change to a CL module, compiled it, and tried to use the Update Program (UPDPGM) command to replace the changed module in the program. However, the update of the program failed because of the storage model of the recompiled module.

    Apparently, the default values for the storage model (and teraspace) have been changed since we migrated from V4R5 to V5R1. The error message (CPD5CD1) says that the module that I am trying to replace was created with storage model *SNGLVL, while the replacement module was created with storage model *INHERIT. I cannot set this

    …

    Read more
  • Get Rid of Old IFS Files

    November 20, 2002 Timothy Prickett Morgan

    Hey, Ted:

    The Integrated File System (IFS) on my system is filling up and I need to clean house. Is there anything in your bag of Qshell tricks that will tell me which files in an IFS directory have not been used recently?

    — Neal

    Yes, Neal, Qshell can handle the job. However, it may not be the best solution. I will show you how to tackle this project with Qshell and then offer an alternative.

    Qshell’s ls utility lists the contents of a directory. To see all the files in a directory in chronological order–from earliest to latest date

    …

    Read more
  • Reader Feedback and Insights: Indicators in RPG II Programs

    November 15, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Just a comment on your good ideas (which were published in the article, “Help with RPG II Programs,” in the November 1 issue of Midrange Guru) for making System/36 style code easier to use.

    I have gotten in the habit of using the DO op code to group calculations that have the same conditioning indicators .

    For example, consider a group of calculations conditioned by indicator 25:

              CHAIN                        25
    N25       MOVE
    N25       Z-ADD
    N25       etc.......
    

    I would group them like this:

              CHAIN                        25
    N25       DO
              MOVE
              Z-ADD
              etc.......
              END
    

    It saves me from loading “fieldicators”

    …

    Read more
  • Access the Database from Qshell

    November 15, 2002 Timothy Prickett Morgan

    Hey, Ted:

    Qshell does a good job when it comes to accessing data in source physical file members and IFS files, but I need to access a database file from a Qshell script. Is that possible?

    — Mike

    IBM provides an undocumented utility called db2 that can execute SQL commands against the database.

    It’s one of those “use it at your own risk” things.

    The following command displays all the records from the COMPANIES file in library mylib.





    db2 "select * from mylib.companies"
    

    Qshell responds with this output.

    COMPANY  COMPNAME
    -------- -------------------------
       1     Leroy's Livery Stable
       2     Pete's Pet Shoppe
    
      
    …

    Read more

Previous Articles Next Articles

Content archive

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

Recent Posts

  • 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
  • Will The Turbulent Economy Downdraft IBM Systems Or Lift It?
  • How IBM Improved The Database With IBM i 7.6
  • Rocket Celebrates 35th Anniversary As Private Equity Owner Ponders Sale
  • 50 Acres And A Humanoid Robot With An AI Avatar
  • IBM i PTF Guide, Volume 27, Number 17

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