• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • CPYSPLF and AFPDS

    February 23, 2005 Ted Holt

    Printing is one of the primary concerns of people who use computers for what I still refer to as data processing, so it’s no wonder I have received a good bit of mail in response to printing-centric articles such as Page 1 of X, Reading Spool Files in RPG, and Extract Reports from Disk Files. Since packaged software is so widely used in installations staffed by readers of this publication, several people have asked about a CPYSPLF equivalent that works with AFPDS. Today, I address that issue.

    At least one astute reader of this publication pointed out that the Page 1 of X tip only worked with SCS spooled files. I couldn’t agree more. The Copy Spooled File (CPYSPLF) command only copies SCS spooled files. So what do you do when you want to read an IPDS or AFPDS spooled file that was produced by some package to which you have no source code? I recently and reluctantly dragged my lazy self out of bed to determine the answer to this question, mainly because one of my superiors told me to.

    I did not like the first solution I found–the Get Spooled File (QSPGETSP) API. QSPGETSP is plenty capable of reading an AFPDS spooled file, but the complexity of this API rivals the instructions that accompany the U.S. federal income tax return. None of that for me.

    Then I discovered something interesting. One would think–or at least I thought–that the type of spooled file produced–SCS, IPDS, or AFPDS–is determined when the printer file object is created. Well, I was wrong. I found that the type of spooled file is determined at runtime.

    The solution is to change or override the DEVTYPE attribute of a printer file so that it produces an SCS spooled file instead of an AFPDS spooled file. (I assume the same can be said of IPDS spooled files, but I was not able to test it to be sure.)

    CHGPRTF FILE(SomePrtf) DEVTYPE(*SCS)
    
    OVRPRTF FILE(SomePrtf) DEVTYPE(*SCS)
    CALL SomePgm
    DLTOVR FILE(SomePrtf)
    

    CPYSPLF will happily copy the text portion of the report to a disk file, which you can read and massage any way you like with a program written in your high-level language of choice.

    –Ted

    Click here to contact Ted Holt by e-mail.


    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Aldon Opens Up to Linux and AIX with Lifecycle Manager 5.0 Counterpane Brings OS/400 Into Its Managed Security Fold

    Leave a Reply Cancel reply

Volume 5, Number 8 -- February 23, 2005
THIS ISSUE
SPONSORED BY:

T.L. Ashford
WorksRight Software
COMMON

Table of Contents

  • CPYSPLF and AFPDS
  • SQL Can Return One or a Few Records
  • Admin Alert: Configuring Output Queues to Print Multi-Copy Spooled Files on Remote Printers

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