• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • One Way To Condense A Verbose Spooled File

    November 29, 2016 Ted Holt

    IBM i includes many reports that we can use to glean a lot of information. If you run packaged software, the vendor likely includes many other reports. The problem with such reports is that they often contain more information than what you need and want. After all, they’re written for the world at large, not tailored for you. It may be that a utility that resides on your system can transform reports into something more suitable for you and those who use your system.

    First, let’s get a report.

    DSPLNK OUTPUT(*PRINT) DETAIL(*EXTENDED) DSPOPT(*USER)
    

    Running this command on one of the systems I use produced a 52-page report.

                           Display Attributes                           Page     2
    5770SS1 V7R1M0  100423                        SYSTEMX   11/30/16  12:00:00 EST
     Object . . . . . . :   /home/tholt/archive.tar
     Type . . . . . . . . . . . . . . . . . :   STMF
     File ID  . . . . . . . . . . . . . . . :   X'00000000000000019748873800074532'
     Owner  . . . . . . . . . . . . . . . . :   THOLT
     System object is on  . . . . . . . . . :   Local
     Auxiliary storage pool . . . . . . . . :   1
       Object overflowed  . . . . . . . . . :   No
     Coded character set ID . . . . . . . . :   819
     Hidden file  . . . . . . . . . . . . . :   No
     PC system file . . . . . . . . . . . . :   No
     Read only  . . . . . . . . . . . . . . :   No
     Need to archive (PC) . . . . . . . . . :   Yes
     Need to archive (System) . . . . . . . :   Yes
     Creation date/time . . . . . . . . . . :   11/01/15  18:39:29
     Last access date/time  . . . . . . . . :   11/01/15  18:40:01
     Data change date/time  . . . . . . . . :   11/01/15  18:40:01
     Attribute change date/time . . . . . . :   11/01/15  18:40:01
     Size of object in bytes  . . . . . . . :   40960
     Allocated size of object . . . . . . . :   65536
     File format  . . . . . . . . . . . . . :   *TYPE2
     Size of extended attributes  . . . . . :   0
     Storage freed  . . . . . . . . . . . . :   No
     Temporary object . . . . . . . . . . . :   No
     Disk storage option  . . . . . . . . . :   *NORMAL
     Main storage option  . . . . . . . . . :   *NORMAL
     Auditing value . . . . . . . . . . . . :   *NONE
     Object domain  . . . . . . . . . . . . :   *SYSTEM
     Number of hard links . . . . . . . . . :   1
     Set effective user ID  . . . . . . . . :   No
     Set effective group ID . . . . . . . . :   No
     Restricted rename and unlink . . . . . :   No
     Last used date . . . . . . . . . . . . :   11/01/15
     Days used count  . . . . . . . . . . . :   1
       Reset date . . . . . . . . . . . . . :
     Allow write during save  . . . . . . . :   No
     Can be saved . . . . . . . . . . . . . :   Yes
     Digitally signed . . . . . . . . . . . :   No
     Object is currently journaled  . . . . :   No
     Object scanning  . . . . . . . . . . . :   *YES
       Scan status  . . . . . . . . . . . . :   *REQUIRED
                           Display Attributes                           Page     3
    5770SS1 V7R1M0  100423                        IUSR011   11/28/16  01:00:49 EST
     System use . . . . . . . . . . . . . . :   *NONE
                           Display Hard Links                           Page     4
    5770SS1 V7R1M0  100423                        IUSR011   11/28/16  01:00:49 EST
    

    If I only want the object names, complete with path, I use this command within Qshell to reduce the report:

    system 'DSPLNK OUTPUT(*PRINT) DETAIL(*EXTENDED) DSPOPT(*USER)' | 
    sed -n '/Object . ./p' | 
    rfile -wQ qsysprt
    

    The system utility executes the DSPLNK command and sends the report to the standard output file, which is piped into sed, the stream editor. Sed selects the lines that contain the string “Object . .” and writes them to standard out, which is piped into the Rfile utility to produce a spooled file.

    The -n switch tells sed not to write to standard output automatically. The p subcommand at the end of the pattern tells sed to print lines that match the pattern.

    My report has shrunk to a single page!

      Object . . . . . . . :   *
      Object . . . . . . :   /home/tholt/archive.tar
      Object . . . . . . :   /home/tholt/archive.tar
      Object . . . . . . :   /home/tholt/custcdt1.txt
      Object . . . . . . :   /home/tholt/custcdt1.txt
      Object . . . . . . :   /home/tholt/custcdt2.txt
      Object . . . . . . :   /home/tholt/custcdt2.txt
      Object . . . . . . :   /home/tholt/custcdt3.txt
      Object . . . . . . :   /home/tholt/custcdt3.txt
      Object . . . . . . :   /home/tholt/customer-data.csv
      Object . . . . . . :   /home/tholt/customer-data.csv
      Object . . . . . . :   /home/tholt/customer-data.txt
      Object . . . . . . :   /home/tholt/customer-data.txt
      Object . . . . . . :   /home/tholt/data.csv
      Object . . . . . . :   /home/tholt/data.csv
      Object . . . . . . :   /home/tholt/data-script.txt
      Object . . . . . . :   /home/tholt/data-script.txt
      Object . . . . . . :   /home/tholt/data2.csv
      Object . . . . . . :   /home/tholt/data2.csv
      Object . . . . . . :   /home/tholt/pay-work.csv
      Object . . . . . . :   /home/tholt/pay-work.csv
      Object . . . . . . :   /home/tholt/pay-work-script.txt
      Object . . . . . . :   /home/tholt/pay-work-script.txt
      Object . . . . . . :   /home/tholt/src.tar
      Object . . . . . . :   /home/tholt/src.tar
      Object . . . . . . :   /home/tholt/yycomp
      Object . . . . . . :   /home/tholt/yycomp
      Object . . . . . . :   /home/tholt/AARDVARK.CSV
      Object . . . . . . :   /home/tholt/AARDVARK.CSV
      Object . . . . . . :   /home/tholt/AARDVARKTX.CSV
      Object . . . . . . :   /home/tholt/AARDVARKTX.CSV
      Object . . . . . . :   /home/tholt/CustCdt.coldef
      Object . . . . . . :   /home/tholt/CustCdt.coldef
      Object . . . . . . :   /home/tholt/CustCdt.csv
      Object . . . . . . :   /home/tholt/CustCdt.csv
    

    Maybe I want a little more information, such as the creation date. Sed can handle that.

    system 'DSPLNK OUTPUT(*PRINT) DETAIL(*EXTENDED) DSPOPT(*USER)' | 
       sed -n -e '/Object . ./p' -e '/Creation date/time/p' |
       rfile -wQ qsysprt
    

    As before, the system utility runs the DSPLNK command and sends the report to sed. Since I want sed to look for two patterns, I must prefix each one with the -e switch. The report is longer, but still a single page. Here’s part of it.

      Object . . . . . . . :   *
      Object . . . . . . :   /home/tholt/archive.tar
      Creation date/time . . . . . . . . . . :   11/01/15  18:39:29
      Object . . . . . . :   /home/tholt/archive.tar
      Object . . . . . . :   /home/tholt/custcdt1.txt
      Creation date/time . . . . . . . . . . :   10/13/15  20:30:31
      Object . . . . . . :   /home/tholt/custcdt1.txt
      Object . . . . . . :   /home/tholt/custcdt2.txt
      Creation date/time . . . . . . . . . . :   10/13/15  19:54:52
      Object . . . . . . :   /home/tholt/custcdt2.txt
      Object . . . . . . :   /home/tholt/custcdt3.txt
      Creation date/time . . . . . . . . . . :   10/13/15  20:28:42
      Object . . . . . . :   /home/tholt/custcdt3.txt
      Object . . . . . . :   /home/tholt/customer-data.csv
      Creation date/time . . . . . . . . . . :   11/01/15  18:27:23
      Object . . . . . . :   /home/tholt/customer-data.csv
      Object . . . . . . :   /home/tholt/customer-data.txt
      Creation date/time . . . . . . . . . . :   10/13/15  23:15:13
      Object . . . . . . :   /home/tholt/customer-data.txt
    

    It isn’t a beautiful report, but I can read it, and that’s all that matters to most users. I’d rather look at a short, ugly report with exactly what I need than a long, beautiful one with unnecessary information any day.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    LaserVault

    Integrate Virtual Tape to Automate Your Backups And Strengthen Your Ability To Recover From Cyber Attacks And Disasters

    With most IT departments stretched thin, finding something that can quickly free up IT time is definitely a bonus. That’s why it’s important to stop and take a look at integrating virtual tape into your backup and recovery. Virtual tape is one of those technologies where once you have it, you’ll wonder why you didn’t do it sooner. See a demo and get a $50 gift card.

    But what is it about using virtual tape that makes it so worthwhile? Why is it that so many IBM i shops are already using or considering using virtual tape for all or part of their backup and recovery systems?

    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.

    “We needed to find a replacement that would lower the maintenance cost and reduce complexity of our backup and recovery functions without a major disruption to our operations.” David Fray, Director of Enterprise Systems, ABC Financial

    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). With ViTL you can:

    • Replace physical tape and tape libraries and eliminate 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

    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.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Profound Logic Software:  NOW ON DEMAND! Webinar: Agile Modernization with Node.js.
    Fresche:  IBM i staffing for all of your IT needs. Request a FREE estimate. 1-800-361-6782
    UCG Technologies:  HEAD INTO 2017 WITH A SYSTEM UPGRADE TO IBM POWER8!

    Forced Windows Migration Failures IBM Tweaks More Power Systems Peripherals

    Leave a Reply Cancel reply

Volume 16, Number 26 -- November 29, 2016
THIS ISSUE SPONSORED BY:

WorksRight Software
Focal Point Solutions Group
UCG Technologies

Table of Contents

  • Fundamentals: Parameter Passing
  • Odds and Ends
  • One Way To Condense A Verbose Spooled File

Content archive

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

Recent Posts

  • IBM Mulls Using DataMigrator as Cloud Warehouse Pipeline
  • PowerTech AV Automatically Detects Ransomware Activity
  • Infor Puts CM3 Project On Hold
  • Four Hundred Monitor, June 29
  • IBM i PTF Guide, Volume 24, Number 26
  • Guild Mortgage Takes The 20-Year Option For Modernization
  • IBM i Licensing, Part 3: Can The Hardware Bundle Be Cheaper Than A Smartphone?
  • Guru: The Finer Points of Exit Points
  • Big Blue Tweaks IBM i Pricing Ahead Of Subscription Model
  • We Still Want IBM i On The Impending Power E1050

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.