|
Yes, QSPGETF and QSPPUTF are two unsupported API-like program's created by IBM and part of OS/400. They are created for the purpose of IBM-support to spoolfile problems and can read/write spoolfiles (attributes and data). The easiest way to use (call) them is just to write command's that uses them as CPP's. The source of theese commands is short enugh to publish here (below). Just a warning: No guarantie that they work and will continue to work. My expierence is: They work. My guess is: They will continue to work. But there are of cause more complex 'official way's' to do this. Writing a "DUPSPLF" is just a matter of creating a workfile in QTEMP and then call the two programs (you might want to do some OVRPRTF too) Another way of duplicating spoolfiles is: SNDNETSPLF (to yourself even or to anybody in the system directory list). For flat SCS spoolfiles it's OK with DTAFMT(*RCDDTA), for anything more complex you need DTAFMT(*ALLDATA). Finally: If you want to program something yourself for flat SCS spoolfiles based on CPYSPLF, then I suggest you use CTLCHAR(*PRTCTL). It takes up four bytes in stead of one, but is easier to read. Here is the source (Use CRTCMD QSPGETF and CRTCMD QSPPUTF to create - the CPP's are already there): -------------------- CMD PROMPT('Get Spooled File (QSPGETF API)') PARM KWD(FILE) TYPE(*NAME) LEN(10) MIN(1) + FILE(*IN) EXPR(*YES) PROMPT('Spooled File') PARM KWD(TOFILE) TYPE(Q01B9) MIN(1) FILE(*OUT) + CHOICE(*NONE) PROMPT('to Data Base File + length 4083') PARM KWD(JOB) TYPE(Q021A) DFT(*) SNGVAL((*)) + PROMPT('Job Name') PARM KWD(SPLNBR) TYPE(*INT2) DFT(*ONLY) RANGE(1 + 9999) SPCVAL((*ONLY 0) (*LAST -1)) + EXPR(*YES) PROMPT('Spooled File Number') PARM KWD(TOMBR) TYPE(*NAME) LEN(10) DFT(*FIRST) + SPCVAL((*FIRST)) EXPR(*YES) PROMPT('To + Member') Q01B9: QUAL TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL) (*CURLIB *CURLIB)) + EXPR(*YES) PROMPT('Library') Q021A: QUAL TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES) QUAL TYPE(*NAME) LEN(10) EXPR(*YES) PROMPT('User') QUAL TYPE(*CHAR) LEN(6) RANGE('000000' '999999') + FULL(*YES) EXPR(*YES) PROMPT('Number') -------------------- CMD PROMPT('Put Spooled File (QSPPUTF API)') PARM KWD(FROMFILE) TYPE(Q01B9) MIN(1) FILE(*IN) + CHOICE(*NONE) PROMPT('from Data Base + File' 10) PARM KWD(TOOUTQ) TYPE(OUTQ) MIN(1) CHOICE(*NONE) + PROMPT('to Outqueue' 30) PARM KWD(FROMMBR) TYPE(*NAME) LEN(10) DFT(*FIRST) + SPCVAL((*FIRST)) EXPR(*YES) PROMPT('From + Member' 20) Q01B9: QUAL TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL) (*CURLIB *CURLIB)) + EXPR(*YES) PROMPT('Library') OUTQ: QUAL TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL) (*CURLIB *CURLIB)) + EXPR(*YES) PROMPT('Library') > Date: Sat, 24 Nov 2001 20:04:07 +0100 > To: midrange-l@midrange.com > From: Carel Teijgeler <COTeijgeler@chello.nl> > Subject: RE: CPYSPLF and retain format > Reply-To: midrange-l@midrange.com > > -- > Instead of using CPYSPLF you may have a look at two utilities QSPGETF and > QSPPUTF, that are on the system but not supported by IBM. Documentation can > be found at the Software Knowledge Base at IBM's site. > > Using those utilities you can place a SPLF into a database file and resore > it to any OUTQ you specify. As far as I know it will keep the original lay > out and works with APFDS SPLF's. > > If interested I wrote a DUPSPLF command using those utilities. > > Regards, > Carel Teijgeler.
As an Amazon Associate we earn from qualifying purchases.
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.