Monday, September 10, 2007

Edit Spool file with SEU:

Please follow the steps to edit the Spool file with SEU
1. Create a program-described non-source physical file member. The record length should be one byte longer than the report. That is, for a 132-column report, create a physical file with 133-byte records.
CRTPF QTEMP/TEMP RCDLEN(133)
2. Use the Copy Spooled File (CPYSPLF) command to place the report in the physical file member you just created. Specify that you want to use first-character forms control in order to prefix each record with skipping and spacing information.
CPYSPLF FILE(QPRTLIBL) TOFILE(QTEMP/TEMP) +
JOB(*) CTLCHAR(*FCFC)
3. Unless you already have one, create a source physical file in which to edit the report. The record length should be 12 bytes more than the physical file you created in step 1.
CRTSRCPF FILE(QTEMP/TEMPSRC) RCDLEN(146) MBR(TEMPSRC)
4. Copy the non-source physical file member to the source physical file member, specifying FMTOPT(*CVTSRC).
CPYF FROMFILE(QTEMP/TEMP) TOFILE(QTEMP/TEMPSRC) +
MBROPT(*REPLACE) FMTOPT(*CVTSRC)
5. Use SEU to edit the report. Remember that the first column is reserved for the forms control characters.
STRSEU SRCFILE(QTEMP/TEMPSRC) SRCMBR(TEMPSRC)
6. Now reverse the process. First copy the source member to the non-source member.
CPYF FROMFILE(QTEMP/TEMPSRC) TOFILE(QTEMP/TEMP) +
MBROPT(*REPLACE) FMTOPT(*CVTSRC)
7. Build a new report by copying the non-source member to a program-described printer file, such as QSYSPRT. You'll need an override to make CPYF interpret the forms control characters.
OVRPRTF FILE(QSYSPRT) CTLCHAR(*FCFC)
CPYF FROMFILE(QTEMP/TEMP) TOFILE(QSYSPRT)

1 comment:

* said...

great idea!
works perfectly
I'm thinkig on type it on a CL
when I do that I'll post here
thanx!