• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Admin Alert: Importing IBM i Spooled Files Into Excel

    September 10, 2014 Joe Hertvik

    For a recent audit, I had to export IBM i spooled file data into Excel spreadsheets to send to our auditors. If you have a similar need for spooled file to Excel conversion, here’s my drill for importing spool file data into an Excel 2010 spreadsheet.

    One Goal, Two Paths

    You can export spooled file data to an Excel file in two ways: by using a commercial product or by using System i Navigator and the Text Import Wizard from Microsoft Excel 2010.

    If you have a third-party product that exports spooled files to Excel format, then by all means use it. It will make your life much easier and avoid the manual steps listed here.

    But if you don’t have a conversion product available, here are three simple steps you can use to import IBM i spooled file data into an Excel 2010 spreadsheet.

    1. On your IBM i partition, create the spooled file you want to export into Excel.
    2. Using System i Navigator (OpsNav), extract and save your spooled file data as a text file (.txt).
    3. Open your text file in Excel 2010 and use Excel’s Text Import Wizard to import your spooled file text into an Excel spreadsheet.

    Here’s my cheat sheet procedure for performing each of these steps.

    Author’s Note: This article was tested using the System i Navigator program that comes with IBM i Access for Windows version 7, release 1, and Microsoft Excel 2010. Also note that this technique may work differently when using different versions of IBM i Access for Windows or Microsoft Excel.

    Step #1: Create the spooled file you want to export into Excel.

    Choose the spooled file you want to turn into an Excel file. For this example, I’ll use a copy of the Work with Active Jobs (WRKACTJOB) listing for one of my systems. I can output a WRKACTJOB screen by running the following command.

    WRKACTJOB OUTPUT(*PRINT)
    

    If I had a third-party product that allowed me to export a spooled file into Excel format, I would just use that software for the Excel 2010 conversion and leave it at that.

    But if I don’t have a spooled file→Excel converter, I would usually perform the next two steps to convert my spooled file text into an Excel spreadsheet file.

    Step 2: Using System i Navigator (OpsNav), extract and save your spooled file data as a text file (.txt).

    System i Navigator (affectionately known by its original nickname “OpsNav”) has a quick and easy feature that lets you convert spooled files to .txt files. You can access that feature by doing the following.

    Go into OpsNav and open the System→Basic Operations→Printer Output node for your target IBM i partition. You’ll see a screen that looks like this.

    Figure 1

    (Click graphic to enlarge.)

    Click on the spooled file that you want to convert into an Excel file and drag and drop that spooled file on to your Windows desktop. This will automatically create a text file that is named after the spooled file you just dragged to the desktop. In this case, I’m dragging the QPDSPAJB output file I created from the WRKACTJOB command to my desktop. Once the spooled file reaches the desktop, OpsNav and Windows will save the report text (complete with formatting) to a text file with the following naming format:

    Spooled_file_nameSpooled_file_number.txt
    

    Where Spooled_file_name is the name of my spooled file and Spooled_file_number is the spooled file number of my target spooled file. In my example, the text file containing my spooled file data was called QPDSPAJB751753.txt.

    Step #3: Open your text file in Excel 2010 and use the Excel Text Import Wizard to import your spooled file text into an Excel spreadsheet.

    Do the following to import your spooled file data into an Excel 2010 spreadsheet.

    Go into Microsoft Excel and click on File→Open from the menu bar. Change the file type to look for Text files (*.prn, *.txt, *.csv) and locate the desktop text file you created out of OpsNav. When Excel 2010 opens your text file, it will automatically execute and show you the first screen of the three-step Text Import Wizard. This screen will look like this.

    Figure 1

    (Click graphic to enlarge.)

    This screen shows you: 1) the location and name of the file you imported (C:UsersjoehDesktopqpdspajb751753.txt in this case); 2) the starting Excel spreadsheet row that you want to import the spooled file data into (the Start import at Row: input box); and 3) the field type that best describes your data. (The Choose the file type that best describes your data radio buttons.)

    Select the Fixed width radio button for your file type. Fixed width refers to file data that is aligned in columns with spaces separating each column or group of data (when I converted my WRKACTJOB spooled file into a text file, OpsNav retained the exact formatting of the original QPDSPAJB file the text file was created from). Fixed Width is the correct choice for an IBM i spooled file text import.

    Click on the Next button to go to step two of the Text Import Wizard. This screen looks like this:

    Figure 1

    (Click graphic to enlarge.)

    Here you can modify where you Excel spreadsheet columns will separate the data and how your text file data is mapped into the spreadsheet cells. The Text Import Wizard will make its best suggestion as to where the data will be broken into columns as it is placed into your Excel cells. Scroll down to where the columnar data is shown and then move the columns to best accommodate and display your text data. You can also double-click on any of the column break lines to delete a column break.

    When you’re satisfied with how Excel will import the spooled file data into your spreadsheet, click on the Next button to go to step three of the wizard. The third screen will look like this.

    Figure 1

    (Click graphic to enlarge.)

    The third screen allows you to format the data in each of your proposed columns. You can format each column according to the following options.

    • General–Converts numeric values to numbers and dates to a calendar format. All other column values are treated as text.
    • Text–Treats the column as straight text without any other modification.
    • Date–Treats column items as date items, formatting each date according to format listed in the attached dropdown box.
    • Do not import column (skip) –Leave this column off the exported spreadsheet.

    Format each column as desired. Excel uses General as its default value.

    Click on the Finish button when you’re finished formatting your columns and ready to import the data into your spreadsheet. This will import your data into the spreadsheet according to the parameters you specified in the wizard.

    Not Quite Finished Yet

    While the Text Import Wizard does a great job of mapping spooled file data into Excel spreadsheet cells, it may not perfectly fit the data to your spreadsheet. After importing your data, you may have to make the following adjustments to your imported data.

    • You may need to increase the width of your columns to accommodate data that is longer than the column breaks you specified in step two of the text import wizard. If too many values fall outside one of your columns, you may even want to reimport the .txt file data with different column widths.
    • Headlines or other non-columnar data that was included in the original spool file may be broken up or mapped incorrectly in the Excel spreadsheet. You may either want to delete the cells or rows that include non-columnar data (if appropriate) or edit the spreadsheet so that headline text shows correctly in your spreadsheet.

    After modifying for these column changes and headline spacing, here’s what my imported WRKACTJOB spooled file looked like after I imported it into Microsoft Excel 2010 using this technique.

    Figure 1

    (Click graphic to enlarge.)

    And that’s all there is to importing spooled file data into a Microsoft Excel spreadsheet.

    Joe Hertvik is an IBM i subject matter expert (SME) and the owner of Hertvik Business Services, a content strategy organization servicing the computer industry. Email Joe for a free quote for any upcoming projects. He also runs a data center for two companies outside Chicago, featuring multiple IBM i ERP systems. Joe is a contributing editor for IT Jungle and has written the Admin Alert column since 2002. Check out his blog where he features practical information for tech users at joehertvik.com.



                         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
    ARCAD Software

    Embrace VS Code for IBM i Development

    The IBM i development landscape is evolving with modern tools that enhance efficiency and collaboration. Ready to make the move to VS Code for IBM i?

    Join us for this webinar where we’ll showcase how VS Code can serve as a powerful editor for native IBM i code and explore the essential extensions that make it possible.

    In this session, you’ll discover:

    • How ARCAD’s integration with VS Code provides deep metadata insights, allowing developers to assess the impact of their changes upfront.
    • The role of Git in enabling seamless collaboration between developers using tools like SEU, RDi, and VS Code.
    • Powerful extensions for code quality, security, impact analysis, smart build, and automated RPG conversion to Free Form.
    • How non-IBM i developers can now contribute to IBM i projects without prior knowledge of its specifics, while ensuring full control over their changes.

    The future of IBM i development is here. Let ARCAD be your guide!

    Register now!

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Profound Logic Software:  October 1 Webinar: "See What i Can Do with Mobile Applications"
    System i Developer:  Upgrade your skills at the RPG & DB2 Summit in Minneapolis, Sept 30 - Oct 2.
    COMMON:  Join us at the COMMON 2014 Fall Conference & Expo in Indianapolis, Oct 27-29

    More IT Jungle Resources:

    System i PTF Guide: Weekly PTF Updates
    IBM i Events Calendar: National Conferences, Local Events, and Webinars
    Breaking News: News Hot Off The Press
    TPM @ EnterpriseTech: High Performance Computing Industry News From ITJ EIC Timothy Prickett Morgan

    JD Edwards Gets 57 New Mobile Apps Actifio Takes Unique Storage Approach to the Cloud

    Leave a Reply Cancel reply

Volume 14, Number 20 -- September 10, 2014
THIS ISSUE SPONSORED BY:

CCSS
ProData Computer Services
WorksRight Software

Table of Contents

  • The Nearly Forgotten DSPLY Operation
  • DB2 for i 7.2 Features and Fun: Part 3
  • Admin Alert: Importing IBM i Spooled Files Into Excel

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