TechTalk: Change the Default Output Queue

CL
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: