Newsletters   Subscriptions  Forums  Store   Career  Media Kit  About Us  Contact  Search   Home 
fhg
Volume 5, Number 8 -- February 23, 2005

CPYSPLF and AFPDS


by 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.


Sponsored By
T.L. ASHFORD

BARCODE400 by T.L. Ashford is the easiest
and fastest way to create and print Compliance
Labels directly from the AS/400 and iSeries.

Ashford's comprehensive library of Compliance formats is available to Barcode400 users. AIAG labels for Ford and Motorcraft, GM, and many more are available. BARCODE400 is backed by the best Technical Support Team in the industry.

FREE Guide to Bar Code Labeling

www.tlashford.com or call 800.541.4893


Technical Editors: Howard Arner, Joe Hertvik, Ted Holt,
Shannon O'Donnell, Kevin Vandever
Managing Editor: Shannon Pastore
Contributing Technical Editors: Joel Cochran, Wayne O. Evans, Raymond Everhart,
Bruce Guetzkow, Marc Logemann, David Morris
Publisher and Advertising Director: Jenny Thomas
Advertising Sales Representative: Kim Reed
Contact the Editors: To contact anyone on the IT Jungle Team
Go to our contacts page and send us a message.


THIS ISSUE
SPONSORED BY:

T.L. Ashford
WorksRight Software
COMMON


BACK ISSUES

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


The Four Hundred
iSeries Resellers Weigh In on the State of the Box

OS/400 PASE Is Not Dead

IBM Focuses on Usability with HATS 6.0

Four Hundred Stuff
Mirifex Delivers a BlackBerry Interface for Legacy Apps

New SSH Options Make Their Way to iSeries

IBM Introduces New LTO 3 Drives and Libraries

Four Hundred Monitor


Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.
Guild Companies, Inc. (formerly Midrange Server), 50 Park Terrace East, Suite 8F, New York, NY 10034
Privacy Statement