× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Even in your SCS example, you can potentially lose the formatting. For example, stuff like CPI, LPI, font size, etc, is not carried in the *FCFC formatting you'd have in your 133 col PF.

With AFPDS, there's a LOT more formatting than that, even... tons and tons of formatting, graphics, fonts, barcodes, lines, pictures, etc. so you aren't going to get anything that resembles the *FCFC physical file that you are trying to replace.

You can use the QSPOPNSP, QSPGETSP, QSPCLOSP APIs to retrieve the raw spooled data into a user space, and you can then read the stuff in the user space, change it, etc, etc. You can then use QSPOPNSP, QSPPUTSP and QSPCLOSP to write the results to a new spooled file.

But it'll never be as simple as working with *FCFC, because there's a LOT more in it.

Howwever, depending on what you want to do (which we still know very little about, even after your explanation) it might be as simple as searching for a string or doing find/replace in the data in the user space...


Tom wrote:
OK, a bit more detail:

We have a report generated by 3rd-party software, from a big vendor with
lots of customers. We want to extract some of the text from the report and
generate a new report (using an overlay). To get the 3rd party vendor to
make a change is a big deal, costing lots of cash and taking at least a
month. As an 'independent' contractor, I can do it way faster and for a
whole lot less.

With *SCS files, I might CPYSPLF to copy it to a 133 record length file
(called 'SPOOLFILE'), write up a quickie program to build a new spoolfile,
printing what I need from the original and apply the overlay.

So... now I need to do this same process on an *AFPDS type of spoolfile.

Tom


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Terrence Enger
Sent: Friday, October 23, 2009 3:21 PM
To: Midrange Systems Technical Discussion
Subject: Re: CPYSPLF and AFPDS

On Fri, 2009-10-23 at 14:17 -0500, Tom wrote:
We're on v5r2. I need to copy an AFPDS spoolfile to a db file, which will
then be accessed within an RPG program. I've tried CPYSPLF, but the
system says it can't do it.



Any ideas?

Tom,

The only idea which jumps out from infocenter-- but somebody here may
know better--is the set of APIs Open Spooled File (QSPOPNSP), Get
Spooled File Data (QSPGETSP), and Close Spooled File (QSPCLOSP) API.
How you map the data in a df file is up to you; I know of no such thing
as a standard mapping.

In the past, I have looked at these APIs only deeply enough to be
encouraged to invent another solution to the problemn at hand. OTOH,
there more doubtless more examples now that when I last cared, google is
better now than when I last cared, and so forth.

Depending on the nature of your spool files and what you want to extract
from them, you may not need to parse the whole AFPDS language. If you
care to tell us about your goal, the people here may be able to suggest
and alternative solution.

Please let us know how you get on.

Cheers,
Terry.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.