AS/400 Spool File Transformation

65 pts.
Tags:
AS/400 Client Access
AS/400 printing
Spool files
I need to be able to add data to a form that is a spool file. Is there a way to be able to edit/update that output and then print?

Answer Wiki

Thanks. We'll let you know when a new response is added.

Yes, there is another easy way but we usually recommend software for this. RPM, OI, and other software packages do this wonderfully. Without ANY programming on the 400 side and gives you tons of flexibility. RPM allows you to save to disk, then modify or add information, then shoots it out to the printer. And RPM will email the file once modified or added to.

Furthermore, <b>you can print it to just about any type of printer</b>, not limited to an AS400 or large network printer… you can print it to your own desktop. Check out how RPM takes the <a href=”http://www.as400tcpipprinting.com/desktopprinting.html”>AS400 spool file and allows you to modify</a>, as I’m sure it will help. We’ve used other vendors also which do work, RPM has had the best track record and best feedback from our clients though.

Best of luck!

Yes, note the *FCFC keywords retain the printer control spacing, newpage, new lines. steps:

0. create a tempory flat file wide enough + 1 (printer file is 132 – create a file 133 wide )
1 copy to a flat file CPYSPLF to your temp flat file include control chara *FCFC

2. edit

3. copy to splf OVRPRTF FILE(QSYSPRT) CTLCHAR(*FCFC) OUTQ(&OUTQ) +
FORMTYPE(COPYPACK) HOLD(*NO) SAVE(*NO) +
USRDTA(DUPLICATE) SPLFNAME(&SPLFNAME)

CPYF FROMFILE(QTEMP/Temp) TOFILE(QSYSPRT)

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • farmgirl1
    Thanks Phil. On the editing... If the spool file documents are Service Orders and there are many to edit, how can I/what type of programming should I use to search through the txt file, find a key word and make an ODBC call back to db file to get the data and update the file. I have never done any spool file editing before. Any sample code would be greatly appreciated? Thank you!!!!!!!!!!!!!!!
    65 pointsBadges:
    report
  • philpl1jb
    Ohhhh That first CPYSPLF gets harder if your spoolfile is an AFPDS file. At the point where you are doing the editing -- it's not a spool file but a row by row image of the spool file. Do not change the values in the first column - those are printer control values. I would write it in RPG or COBOL on the 400. It could be done in VB or Java but I wouldn't be much with those. It would be really difficult in an SQL procedure - you probably need header info from the top of the page as well as detailed lines.
    49,940 pointsBadges:
    report
  • farmgirl1
    Thanks again Phil - I will check it out!
    65 pointsBadges:
    report
  • farmgirl1
    Oh - and you know I just happen to be an old rpg programmer!
    65 pointsBadges:
    report
  • philpl1jb
    Old?
    49,940 pointsBadges:
    report
  • farmgirl1
    Young RPG Programmer...
    65 pointsBadges:
    report
  • TomLiotta
    That first CPYSPLF gets harder if your spoolfile is an AFPDS file. CPYSPLF can't be reliably used with AFPDS. Many AFPDS elements cannot be translated to a flat physical file. ...and make an ODBC call back to db file... ODBC probably won't won't enter into the process at all. It doesn't make much sense. For AFPDS, the spooled file probably would be much better copied into a user space (or spaces) with the Spooled File APIs due to non-character elements. Modifying the space content might be very difficult, particularly if any insertion of data rather than a character-by-character replacement is done. You won't want to handle changes in displacement within the space. A single byte pushed past the end of the space could effectively destroy the result. As is always the case on every platform, spooled files are intended not to be modified. It can be done relatively easily on AS/400s, but it always carries issues. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following