• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Don’t Disable Blocking

    September 19, 2007 Ted Holt

    Do you ever bother to look at warning messages after a successful program compilation? Most warning messages contain no useful information, but the few that do can make a difference. One message that I am always glad to see in RPG compiler listings is RNF7086.

    So what is RNF7086? The text reads, “RPG handles blocking for the file. INFDS is updated only when blocks of data are transferred.” This message is a good indicator that the system is going to handle the transfer of data between a database file and the program’s buffers in an efficient manner. As efficiently as possible? Maybe not, but well enough.

    Assume a program that reads a database file sequentially. Each time the program issues a read operation (sometimes called a get operation), the system gives it the data for one record. This behavior suits the program just fine, because the program can only process one record at a time anyway. If the system has to go to disk each time the program reads, the program is left with nothing to do while the slow disk access takes place.

    Blocking has long been used to speed up input/output operations. Memory operations are fast; disk access is much slower. Blocking makes a program use more memory in order to reduce the number of disk accesses. Reducing the number of disk accesses makes the program run faster.

    Assume the same program with blocking applied. Each time the system goes to disk for data, it brings back more than one record into memory. Maybe it brings back the data of 10, 50, or 100 records. Each time the program reads, the system first looks to see if there are any unprocessed records in memory. If so, it sends data for one record to the program. This is a memory operation, which is fast. But if not, it goes to disk for another group of records, then passes the first one of the group to the program.

    Occasionally I work on a program in which a programmer has inadvertently disabled buffering. That is, each read to a file retrieves only one record. The programmer disabled buffering by including an unnecessary random-access operation. The operation I most often see is the Set Lower Limit (SETLL) operation in RPG programs. (COBOL programmers will know this operation as START.)

    FSomeFile  if   e           k disk
     /free
         setll *loval SomeFile;
         dow '1';         
            read SomeFile;  
            if %eof();    
               leave;     
            endif;        
              // do more stuff to process the record
         enddo;           
    

    The program processes the record sequentially, from top to bottom. That is, the READ op code is a sequential operation. The programmer has disabled blocking by using the unnecessary SETLL op code.

    How much of a gain could he expect if he removed SETLL? It’s hard to say, but I ran a quick unscientific test against a file of almost eleven and a half million records, and the version with SETLL ran 25 percent longer.

    So that’s your tip for the day: Don’t disable blocking. Now for another tip: If you don’t need to access a file by key, then don’t. I ran a third test, with the record address type of K removed from the F spec. Run time was about one-fourth of the blocked keyed version. The following short table summarizes the results of the three runs.

    Test

    Run time in CPU seconds

    Arrival sequence

    16

    Keyed sequence, blocked

    60

    Keyed sequence, unblocked

    75

    –Ted



                         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
    LaserVault

    Integrate Virtual Tape For Better Backups, Faster Recovery, And More Flexibility

    Virtual tape and virtual tape libraries offer a way to both simplify and strengthen backup and recovery operations. By incorporating virtual tape technology, automation of backups becomes possible resulting in hundreds of hours saved annually for IT departments and personnel.

    LaserVault ViTL is a virtual tape and tape library solution developed specifically for use with IBM Power Systems (from AS/400 to iSeries to Power 9s). See a demo and get a $50 gift card.

    With ViTL you can:

    • Replace physical tape and tape libraries and associated delays
    • Automate backup operations, including the ability to purge or archive backups
    • Remotely manage your backups – no need to be onsite with your server
    • Save backups to a dedupe appliance and the cloud
    • Recover your data at lightspeed greatly improving your ability to recover from cyberattacks
    • And so much more

    “The ViTL tapeless solution has truly made my job easier. It has given me more confidence in our full system recovery ability – but at the same time I hope it is never needed.” IBM i Administrator at a financial services company

    Sign-up now to see a ViTL online demo and get a $50 Amazon e-gift card when the demo is complete as our way of saying thanks for your time. Plus when you sign-up you’ll receive a free facts comparison sheet on using virtual tape vs tape so you can compare the functionality for yourself.

    LaserVault.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    COMMON:  Join us at the annual 2008 conference, March 30 - April 3, in Nashville, Tennessee
    ARCAD Software:  Organize and automate multi-platform application change around your System i
    NowWhatJobs.net:  NowWhatJobs.net is the resource for job transitions after age 40

    IT Jungle Store Top Book Picks

    The System i Pocket RPG & RPG IV Guide: List Price, $69.95
    The iSeries Pocket Database Guide: List Price, $59.00
    The iSeries Pocket Developers' 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
    iSeries Express Web Implementer's Guide: List Price, $59.00
    Getting Started with WebSphere Development Studio for iSeries: List Price, $79.95
    Getting Started With WebSphere Development Studio Client for iSeries: List Price, $89.00
    Getting Started with WebSphere Express for iSeries: List Price, $49.00
    WebFacing Application Design and Development Guide: List Price, $55.00
    Can the AS/400 Survive IBM?: List Price, $49.00
    The All-Everything Machine: List Price, $29.95
    Chip Wars: List Price, $29.95

    Intalio’s Open Source BPMS Becomes Full Apache Project SAP Plants Its Flag in Mid-Market Territory with SaaS Apps

    Leave a Reply Cancel reply

Volume 7, Number 32 -- September 19, 2007
THIS ISSUE SPONSORED BY:

WorksRight Software
ProData Computer Services
Twin Data

Table of Contents

  • System i Developers and .NET 2.0: ASP.NET and the Declarative Programming Model
  • Don’t Disable Blocking
  • Admin Alert: When APPN Prevents You from Changing Network Attributes

Content archive

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

Recent Posts

  • IBM i 7.3 TR12: The Non-TR Tech Refresh
  • IBM i Integration Elevates Operational Query and Analytics
  • Simplified IBM i Stack Bundling Ahead Of Subscription Pricing
  • More Price Hikes From IBM, Now For High End Storage
  • Big Blue Readies Power10 And IBM i 7.5 Training for Partners
  • IBM Delivers More Out-of-the-Box Security with IBM i 7.5
  • Groundhog Day For Malware
  • IBM i Community Reacts to IBM i 7.5
  • Four Hundred Monitor, May 11
  • IBM i PTF Guide, Volume 24, Number 19

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 © 2022 IT Jungle

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.