Midrange News for the IBM i Community


Posted by: Bob Cozzi
Rogue Programmer
Cozzi Productions, Inc.
Chicagoland
Prevent DLTSPLF or Option 4 for SPOOL Files
has no ratings.
Published: 31 Aug 2012
Revised: 23 Jan 2013 - 1765 days ago
Last viewed on: 23 Nov 2017 (3532 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.

Prevent DLTSPLF or Option 4 for SPOOL Files Published by: Bob Cozzi on 31 Aug 2012 view comments(3)

I have users who create reports at month-end. I've built a hook into the Print Monitoring exit point via a data queue. When a report is created on any outputq by the use, that report is copied to an archival outq for safekeeping.

Sadly, when the user does WRKSPLF they also see the copied SPOOL file now in the Archive outq, and often will just delete it along with their own reports once they've printed hard copy.

We need to keep these for archival purposes, however.

I'm looking for an exit point or SPOOL File Attribute that says "you can't delete this". Any suggestions?

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

COMMENTS

(Sign in to Post a Comment)
Posted by: jjcllhn
Premium member *
Comment on: Prevent DLTSPLF or Option 4 for SPOOL Files
Posted: 5 years 2 months 22 days 5 hours 18 minutes ago

Assuming your process retains the user as the owner of the spool file, it's going to be difficult to prevent the owner from managing spool files it has created. If WRKSPLF sends a DLTSPLF command, you'd be able to examine the command using the QIBM_QCA_CHG_COMMAND exit point and change it if the command was pointed at an archive output queue, but if it calls the delete spool file api directly that won't help.

If you're using the QSPCRTSP to duplicate the spool file, you might consider changing the owner (creating the duplicate under a spool archive user profile), retain the originating job info in the USRDFNDTA, and changing the archive output queue to allow public display of its entries (AUT(*USE), DSPDTA(*YES)).

 

 

 

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Prevent DLTSPLF or Option 4 for SPOOL Files
Posted: 5 years 2 months 22 days 2 hours 33 minutes ago
Edited: Tue, 04 Sep, 2012 at 13:45:29 (1906 days ago)

Change the Owner is the solution but I could swear someone told me there was a way to attach a data queue to a specific OUTQ and then monitor that data queue--I could then change the owners at things were added to the OUTQ (and even change to SAVE(*YES) so that they won't evaporate if inadvertently printed.)

Apparently there is a DTAQ parameter on OUTQ De!--script--ions. But it only signals when the SPOOL file is in RDY (ready) state. I need it even if the SPOOL file is created in SAV state.

Posted by: jjcllhn
Premium member *
Comment on: Prevent DLTSPLF or Option 4 for SPOOL Files
Posted: 5 years 2 months 20 days 16 hours 28 minutes ago
Isn't that (DTAQ entry written only when the spool file goes to RDY state) what put you on a path to looking at the QIBM_NOTIFY_CRTSPLF environment variable? Have you considered swapping the order of events- writing the original spool file to the archive output queue under a different user profile to prevent it from being deleted, and using the data queue entry to create a duplicate spool file back to the originating user?