TechTalk: Hold WRKACTJOB Print

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

Hold WRKACTJOB Print

Q: I have a CL program that runs the Work with Active Jobs (WRKACTJOB) command, the Copy Spool File (CPY-SPLF) command and then a program and finally deletes the spool file and the database file I created. The problem is that when it runs from the console, it goes to the printer and prints. I can use the Hold Writer (HLDWTR) command at the start of the CL program and the Release Writer (RLSWTR) command at the end. But is this the best way to do it? I do not want to stop any prints in the middle.

- Willie Moore

A: Each OS/400 command that prints something uses a special (usually different) printer file. All you need to do is override the printer file with HOLD(*YES) before running the command; this way, the printout will come out already on hold. You don't have to hold (or end) the writer.

To find out which printer file you have to override, run the command you're interested in and use the Work with Spool Files (WRKSPLF) command to see the file name (it's the left-hand column). Therefore, your CL program would look like this:

 OVRPRTF FILE(QPDSPAJB) HOLD(*YES) WRKACTJOB OUTPUT(*PRINT) CRTPF FILE(QTEMP/ACTJOBRPT) + RCDLEN(132) MONMSG MSGID(CPF0000) CPYSPLF FILE(QPDSPAJB) + TOFILE(QTEMP/ACTJOBRPT) + SPLNBR(*LAST) DLTSPLF FILE(QPDSPAJB) + SPLNBR(*LAST) DLTOVR FILE(QPDSPAJB) 

WRKACTJOB uses printer file QPDSPAJB. I just found that out by using the method I mentioned. Other commands use different printer files-Display Object Description (DSPOBJD), for instance, uses QPRTOBJD.

Editor's note: For a generic solution to obtaining output to a database file for those commands that don't have outfile support, see the Convert Print to Physical File command in the "Using OUTPUT(*PRINT)" TechTalk of the March 1992 issue of MC.

- Ernie Malaga

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: