Merging AFPDS spool files

Hi all,

I am taking my first steps in programatically manipulating AFPDS spool files.
The files are there, I have to merge them, just joining...
2 files of 2 pages should become 1 file of 4 pages.
Is that as straightforward as I think it is?
Can I get some hints on how to do it?
Can someone point me to a good resource to understand the AFPDS format?
thanks

Gertone
LVL 60
Geert BormansInformation ArchitectAsked:
Who is Participating?
 
daveslaterCommented:
Hi
you will need to use the following API's to get the information
The Open Spooled File (QSPOPNSP) API opens an existing spooled file.

the Get Spooled File Data (QSPGETSP) API can then get the data from the file opened by the API above.

The Close Spooled File (QSPCLOSP) API closes a spooled file opened by the Open Spooled File (QSPOPNSP).

The Retrieve Spooled File Attributes (QUSRSPLA) API returns specific information about a spooled file. This may be need to to check page size etc...

you can then use
The Create Spooled File (QSPCRTSP) API is used to create a new spooled file and put the information from the user space into the user space used by this API.

Dave



0
 
daveslaterCommented:
Hi
this is not as easy as you may first think.

You will need to delv into user space and API programming in order to get the spool file data - even then it may not work.

Dave
0
 
tliottaCommented:
Agreed. It's hard enough getting this kind of thing done for SCS spooled files much less AFPDS. This is _not_ for the faint of heart.

Tom
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
Geert BormansInformation ArchitectAuthor Commented:
OK, I understand it is though,
still I have to do it.
Any usefull hints?
Tools out there I can use?
Thanks

Geert
0
 
daveslaterCommented:
Hi
Ok we shall begin - download the User space tools from:

http://www.netshare400.com/cgi-bin/DSPSAMP?file=QRPGLESRC&mbr=FUSP

Get them compiled - I will look into the API side to things.

Dave
0
 
daveslaterCommented:
Ps
this may take some time - If it is urgent then best get expectations set.

It will be trial and error for us all :-)

Dave
0
 
tliottaCommented:
Questions:

Is this a project that should handle _any_ two (or more) AFPDS spooled files? Or is it for two specific AFPDS spooled files? Are these spooled files simply described as AFPDS or do they make significant use of AFPDS facilities? (I.e., are there various external AFPDS resources used? Are images included? fancy print options? Other? Or are these just regular lines of print that just happen to be sent as AFPDS files?)

If we're talking simple line printer output as AFPDS, this is probably reasonably doable. OTOH, if this must account for multiple external and unpredictable AFPDS resources, might as well plan for it taking a few months.

Tom
0
 
tliottaCommented:
Note... once the QSPGETSP API retrieves data into a user space, you will probably want to look the space over to get mental pictures of what you're dealing with. One command can be useful:

 ==>  dmpobj  obj( mylib/myspc ) objtype( *usrspc )

That will print an object dump so you can compare it against documentation of what should be in the space. As an alternative:

 ==>  dmp  obj( '/qsys.lib/mylib.lib/myspc.usrspc' )

...does the same, but it works in the IFS naming format. It also helps get the idea that a *USRSPC object is essentially the same underlying object type as an IFS streamfile.

Tom
0
 
daveslaterCommented:
Hi
just looking at the site thre is all the code to get and put the spool file here

http://www.netshare400.com/cgi-bin/DSPSAMP?file=QRPGLESRC&mbr=SPLFAPI

Dave
0
 
Geert BormansInformation ArchitectAuthor Commented:
Hi all,

can not say my problem is completely solved, but...
I learned how to get started, will do some research now based on the answers received.
And will definitely reopen this tread as soon as I feel ready to get started.
Thanks for all the help sofar.
I will split the points in what I think being a fair split.
I hope I don't hurt anyone's feelings... I will need your help later I guess :-)

Gertone
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.