|
Chuck, Here's a command I use to move all spool files from one output queue to another. It can be easily adapted to move specific spool files. MovOutq Command: Cmd Prompt('Move Output Queue') Parm Kwd(FromQueue ) + Type(Qual1 ) + Min(1 ) + Prompt('From Output Queue') Parm Kwd(ToQueue ) + Type(Qual2 ) + Min(1 ) + Prompt('To Output Queue') Qual1: + + Qual Type(*Name ) + Qual Type(*Name ) + Dft(*Libl ) + SpcVal((*LIBL )) + Expr(*Yes ) + Prompt('Library') Qual2: + + Qual Type(*Name ) + Qual Type(*Name ) + Expr(*Yes ) + Prompt('Library') MovOutq Program: Pgm Parm(&FromQueue + &ToQueue ) /********************************************************************/ /* File and variable declares. */ /********************************************************************/ DclF File(MovOutQPF ) Dcl Var(&FromQueue ) + TYPE(*Char ) + LEN(20 ) Dcl Var(&ToQueue ) + Type(*Char ) + Len(20 ) Dcl Var(&FromQueNam) + TYPE(*Char ) + LEN(10 ) Dcl Var(&FromLib ) + Type(*Char ) + Len(10 ) Dcl Var(&ToQueNam ) + TYPE(*Char ) + LEN(10 ) Dcl Var(&ToLib ) + Type(*Char ) + Len(10 ) /********************************************************************/ /* Break out queue information. */ /********************************************************************/ ChgVar Var(&FromQueNam) + Value(%sst(&FromQueue 1 10)) ChgVar Var(&FromLib ) + Value(%sst(&FromQueue 11 10)) ChgVar Var(&ToQueNam ) + Value(%sst(&ToQueue 1 10)) ChgVar Var(&ToLib ) + Value(%sst(&ToQueue 11 10)) /********************************************************************/ /* Get spool information. */ /********************************************************************/ CrtPF File(Qtemp/Temp) + RcdLen(132 ) MonMsg MsgID(cpf7302 ) + Exec(ClrPFM + File(QTemp/Temp)) CrtOutQ OutQ(&ToLib/&ToQueNam) MonMsg MsgID(cpf3353 ) WrkOutQ OutQ(&FromLib/&FromQueNam) + OutPut(*Print ) MonMsg MsgID(cpf3357 ) + Exec(Do ) SndPgmMsg MsgId(cpf9898 ) + MsgF(QcpfMsg ) + MsgDta('Output queue' *bcat &FromQueNam + *bcat 'in library' *bcat + &FromLib *bcat 'does not exis+ t') + MsgType(*Comp ) GoTo CmdLbl(EndPgm ) EndDo CpySplF File(QPrtSplQ ) + ToFile(QTemp/Temp) + SplNbr(*Last ) CpyF FromFile(Qtemp/Temp) + ToFile(MovOutQPF) + MbrOpt(*Replace) + IncChar(*Fld 102 *eq /) + FmtOpt(*NoChk ) /****************************************************** /* Move files to specified output queue. /****************************************************** RcvF: RcvF MonMsg MsgID(cpf0864 ) + Exec(GoTo + CmdLbl(EndPgm )) ChgSplFA File(&FileName ) + Job(&JobNum/&User/&JobName) + SplNbr(&FileNum) + OutQ(&ToLib/&ToQueNam) GoTo CmdLbl(RcvF ) EndPgm: DltSplF File(QPrtSplQ ) + SplNbr(*Last ) MonMsg MsgId(cpf9999 ) EndPgm MovOutPF DDS: A R QPRTSPLQ A FILLER1 1A COLHDG('FILL1') A TEXT('Filler Info') A FILENAME 10A COLHDG('SPLFILE') A TEXT('SpoolFile Name') A FILLER2 1A COLHDG('FILL2') A TEXT('Filler Info') A USER 10A COLHDG('USER') A TEXT('User of Job') A FILLER3 13A COLHDG('FILL3') A TEXT('Filler Info') A STATUS 4A COLHDG('STS') A TEXT('SpoolFile Status') A FILLER4 33A COLHDG('FILL4') A TEXT('Filler Info') A FILENUM 4S COLHDG('FILE #') A TEXT('SpoolFile Number') A FILLER5 5A COLHDG('FILL5') A TEXT('Filler Info') A JOBNAME 10A COLHDG('JOBNM') A TEXT('Job Name') A FILLER6 1A COLHDG('FILL6') A TEXT('Filler Info') A JOBNUM 6A COLHDG('JOB #') A TEXT('Job Number') A FILLER7 1A COLHDG('FILL7') A TEXT('Filler Info') A DATE 8A COLHDG('DATE') A TEXT('Job Date') A FILLER8 25A COLHDG('FILL8') A TEXT('Filler Info') HTH, Todd Kidwell (Netstar) AS/400 System Administrator (313) 224-0578 >>> Chuck Lewis <clewis@iquest.net> 07/10/00 09:57AM >>> Hi All, Is there an API or something that lets you MOVE a spool file to another outq via a program ? There MUST be since a 2 next to a Spool File lets you key in an outq name. I THOUGHT I had done this YEARS ago but cannot find any example of it now... TIA ! Chuck +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +--- +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.