Our shop is configured with multiple printers attached to PCs via a Token- Ring. We have a requirement for users to direct output to various printers on demand. CHGDFTOUTQ command (1) and CL program DFT001CL (2) were created to change the user's Default Output Queue. The CL program defaults to resetting the queue to the one specified in the user's profile. It also edits the input to ensure a valid OUTQ is entered and returns a verification message upon completion. The user must have special authority of *SPLCTL (spool control) to change the OUTQ; therefore the CL program was compiled with the user profile set to *OWNER so anyone could execute it.
Our shop is configured with multiple printers attached to PCs via a Token- Ring. We have a requirement for users to direct output to various printers on demand. CHGDFTOUTQ command (Figure 1) and CL program DFT001CL (Figure 2) were created to change the user's Default Output Queue. The CL program defaults to resetting the queue to the one specified in the user's profile. It also edits the input to ensure a valid OUTQ is entered and returns a verification message upon completion. The user must have special authority of *SPLCTL (spool control) to change the OUTQ; therefore the CL program was compiled with the user profile set to *OWNER so anyone could execute it.
Brooks Stephan Norfolk, Virginia
TechTalk: Change the Default Output Queue
Figure 1 Command CHGDFTOUTQ
CMD PROMPT('Change Default OUTQ') PARM KWD(OUTQ) TYPE(*CNAME) LEN(10) PROMPT('Outq + Name') + DFT(*USRPRF) SPCVAL((*USRPRF))
TechTalk: Change the Default Output Queue
Figure 2 CL program DFT001CL
/* This program must be compiled with the parameter USRPRF set + to '*OWNER' so users can execute the program. */ DFT001CL: + PGM PARM(&OUTQ) DCL VAR(&OUTQ) TYPE(*CHAR) LEN(10) DCL VAR(&PRTR) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(100) MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) IF COND(&OUTQ *EQ '*USRPRF') THEN(DO) RTVUSRPRF OUTQ(&OUTQ) PRTDEV(&PRTR) ENDDO IF COND(&OUTQ *EQ '*DEV') THEN(DO) CHGVAR VAR(&OUTQ) VALUE(&PRTR) ENDDO IF COND(&OUTQ *EQ '*SYSVAL') THEN(DO) RTVSYSVAL SYSVAL(QPRTDEV) RTNVAR(&OUTQ) ENDDO CHGOUTQ OUTQ(&OUTQ) CHGJOB OUTQ(&OUTQ) CHGVAR VAR(&MSGDTA) VALUE('Output queue changed to') CHGVAR VAR(%SST(&MSGDTA 26 10)) VALUE(&OUTQ) SNDPGMMSG MSG(&MSGDTA) RETURN ERROR: + RCVMSG MSGDTA(&MSGDTA) MSGID(&MSGID) SNDPGMMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGDTA(&MSGDTA) + MSGTYPE(*COMP) ENDPGM
LATEST COMMENTS
MC Press Online