Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Application Development Trivia 1
has no ratings.
Published: 05 Sep 2012
Revised: 23 Jan 2013 - 1553 days ago
Last viewed on: 25 Apr 2017 (2846 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

Application Development Trivia 1 Published by: Bob Cozzi on 05 Sep 2012 view comments

Problem: User is saying that their sensitive printed output is remaining in the OUTPUT QUEUE after it is printed. This had never occurred before. Why it is "suddenly" happening?

Resolution: Another program that the User runs frequently generates a set of Reports from RPGIII and RPG IV applications and they requested that they be saved in their output queues even after printing. So in that job stream, the following CL command was added:

OVRPRTF FILE(*PRTF) SAVE(*YES) OVRSCOPE(*JOB)

It turns out that the end-users is calling this 2nd program throughout the day, and then ran their sensitive report (payroll checks). The previous OVRPRTF to *PRTF means "*ALL" and the override scope of *JOB means it doesn't go away until the user signs off. Therefore, their 2nd program, the one that includes the OVRPRTF needed to include a DLTOVR *PRTF LVL(*JOB) when it was finished producing reports. Problem solved!

So remember to include the following CL command when you override *ALL print files:

DLTOVR FILE(*PRTF) LVL(*JOB)

Don't Be a Dick

While the above DLTOVR command solves this problem, don't be a dick by inserting the following lazy DLTOVR command:

DLTOVR FILE(*ALL) LVL(*JOB)

If you see this type of CL statement, in most (not all, but most) cases the programmer was far too lazy to insert the specific delete override commands to the files in question. I've seen this in mid-job stream where I've gone in and inserted a new override; and in that same program a previous programmer inserted 3 or 4 overrides and then called an RPG program. After the call, they issued the DLTOVR *ALL command to get rid of them. Of course my new OVRxxx command was also deleted, even though I needed it later on in the job stream. Remember DLTOVR FILE(*ALL) LVL(*JOB) applies to every program you've run in your job at any point.

Scenario:

  • Program A issues OVRPRTF MYPRINT SAVE(*YES) LVL(*JOB)
  • Program A calls Program B
  • Program B issues:
    • OVRDBF A TOFILE(QTEMP/A) OVRSCOPE(*JOB)
    • OVRDBF B TOFILE(QTEMP/B) OVRSCOPE(*JOB)
    • CALL Program C
    • DLTOVR *ALL LVL(*JOB)
  • Program B calls Program D which uses MYPRINT
  • Program D does not see the OVRPRTF SAVE(*YES) because Program B deleted it

Never use DLTOVR *ALL unless you are ONLY using *CALLLVL overrides in your program.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS