× 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.



Use the QSPGETF and QSPPUTF print utilities.

Brgds

Helge



/* CRTCMD CMD(LIB/GETSPLF) PGM(QSYS/QSPGETF) SRCFILE(LIB/SRCPF)
*/
/* SRCMBR(*CMD) TEXT('GET SPOOLED FILE USING THE QSPGETF PRINT UTILITY')
*/
/*
*/
/* WORKFILE:
*/
/* CRTPF FILE(LIB/FILE) RCDLEN(4083) MAXMBRS(*NOMAX) SIZE(*NOMAX)
*/
/* LVLCHK(*NO)
*/

CMD PROMPT('GET SPOOLED FILE')
PARM KWD(FILE) TYPE(*NAME) LEN(10) MIN(1) +
FILE(*IN) EXPR(*YES) PROMPT('SPOOLED FILE')
PARM KWD(TOFILE) TYPE(Q1) MIN(1) FILE(*OUT) +
CHOICE(*NONE) PROMPT('TO DATA BASE FILE')
PARM KWD(JOB) TYPE(Q2) DFT(*) SNGVAL((*)) +
PROMPT('JOB NAME')
PARM KWD(SPLNBR) TYPE(*INT4) DFT(*ONLY) RANGE(1 +
999999) 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')
Q1: QUAL TYPE(*NAME) LEN(10) MIN(1) EXPR(*YES)
QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB *CURLIB)) +
EXPR(*YES) PROMPT('LIBRARY')
Q2: 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')



/* CRTCMD CMD(LIB/PUTSPLF) PGM(QSYS/QSPPUTF) SRCFILE(LIB/SRCPF)
*/
/* SRCMBR(*CMD) TEXT('PUT SPOOLED FILE USING THE QSPPUTF PRINT UTILITY')
*/
/*
*/
PUTSPLF: CMD PROMPT('PUT SPOOLED FILE')
PARM KWD(FROMFILE) TYPE(Q1) RTNVAL(*NO) MIN(1) +
MAX(1) FILE(*OUT) PROMPT('FROM FILE')
PARM KWD(OUTQ) TYPE(Q1) RTNVAL(*NO) MIN(1) +
MAX(1) FILE(*OUT) PROMPT('OUTPUT QUEUE')
PARM KWD(FROMMBR) TYPE(*NAME) LEN(10) RTNVAL(*NO) +
RSTD(*NO) DFT(*FIRST) SPCVAL((*FIRST)) +
MIN(0) MAX(1) FILE(*NO) FULL(*NO) +
EXPR(*YES) VARY(*NO) PASSATR(*NO) +
PROMPT('FROM MEMBER')
Q1: QUAL TYPE(*NAME) LEN(10) RSTD(*NO) MIN(1) +
FULL(*NO) EXPR(*YES) VARY(*NO) PASSATR(*NO)
QUAL TYPE(*NAME) LEN(10) RSTD(*NO) DFT(*LIBL) +
SPCVAL((*LIBL) (*CURLIB *CURLIB)) MIN(0) +
FULL(*NO) EXPR(*YES) VARY(*NO) +
PASSATR(*NO) PROMPT('LIBRARY')


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of praveen gunda
Sent: Monday, July 09, 2007 10:56 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: Saving and restoring spooled files


The spool file I am trying to save is AFPDS and as such I can not use
CPYSPLF command.
Sorry, forgot to mention in my original msg

-Praveen


On 7/9/07, Kesterson, Randy <RPKesterson@xxxxxxxxxxxxxxxxxxx> wrote:

It's fairly simple. You copy your spool file to disk using cpysplf making
sure you have CTLCHAR(*FCFC) in the command. Then you do and OVRPRTF to
the
printer file name, specifying the outq device you want it to go to, and
then
do a cpyf of the saved file name to the Printer filename you would like,
such as qsysprt. A Snip-it would be. (Put what's necessary in the
variable
parameters.)

CPYSPLF FILE(&FILE) TOFILE(PRINTED) JOB(&JOB) +
SPLNBR(*LAST) CTLCHAR(*FCFC)

OVRPRTF FILE(QSYSPRT) PAGESIZE(&PAGLGT &PAGWDT) +
LPI(&LPI) CPI(&CPI) RPLUNPRT(*YES) +
CTLCHAR(*FCFC) CHLVAL(*NORMAL) +
PRTTXT(&NAME) OUTQ(&DEVICE) +
HOLD(*NO) USRDTA(&INIT)

CPYF FROMFILE(MTLR7LIB/PRINTED) TOFILE(QSYSPRT)






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.