× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: RE: help deleting spool files
  • From: "Burrows, Thomas 1001" <Burrows.Thomas@xxxxxxxxxxxxxx>
  • Date: Thu, 21 Mar 2019 03:21:15 +0000
  • List-archive: <https://archive.midrange.com/rpg400-l/>
  • List-help: <mailto:rpg400-l-request@lists.midrange.com?subject=help>
  • List-id: RPG programming on IBM i <rpg400-l.lists.midrange.com>
  • List-post: <mailto:rpg400-l@lists.midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/rpg400-l>, <mailto:rpg400-l-request@lists.midrange.com?subject=unsubscribe>
  • Msip_labels: MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_Enabled=True; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_SiteId=63ce7d59-2f3e-42cd-a8cc-be764cff5eb6; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_Owner=thomas.burrows@xxxxxxxxxxxxxx; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_SetDate=2019-03-21T03:21:20.0298639Z; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_Name=Internal; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_Application=Microsoft Azure Information Protection; MSIP_Label_be4b3411-284d-4d31-bd4f-bc13ef7f1fd6_Extended_MSFT_Method=Automatic; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Enabled=True; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_SiteId=63ce7d59-2f3e-42cd-a8cc-be764cff5eb6; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Owner=thomas.burrows@xxxxxxxxxxxxxx; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_SetDate=2019-03-21T03:21:20.0298639Z; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Name=Companywide usage; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Application=Microsoft Azure Information Protection; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Parent=be4b3411-284d-4d31-bd4f-bc13ef7f1fd6; MSIP_Label_a0819fa7-4367-4500-ba88-dd630d977609_Extended_MSFT_Method=Automatic; Sensitivity=Internal Companywide usage

Thanks for the suggestion. Will try this out and report back.

-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Steinmetz, Paul via RPG400-L
Sent: Wednesday, March 20, 2019 10:13 PM
To: 'RPG programming on IBM i' <rpg400-l@xxxxxxxxxxxxxxxxxx>
Cc: Steinmetz, Paul <PSteinmetz@xxxxxxxxxx>
Subject: RE: help deleting spool files

[ External Email ]

----------------------------------------------------------------------
Thomas,



We also had an issue with spoolfile cleanup.



Below is our solution using a combination of IBM API QSPROUTQ and TAATOOL DLTOLDSPLF.

Also, as part of our nightly BRMS full save, we save all spoolfiles every night from all outqs, for recovery purposes..

Save spooled file data . . . . . . . . . *ALL



1) Create an AJS scheduled job, DLTOLDSPLF, that runs daily.

DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*OUTQ) DETAIL(*FULL) OUTPUT(*OUTFILE) OUTFILE(QGPL/OUTQPURGE) /*

CALL PGM(QGPL/OUTQPURGE) PARM('*DELETE') /* *CHECK or *DELETE */



2) Created CLP pgm,OUTQPURGE, which reads each OUTQ from OUTQPURGE PF.



We needed a way to control the number of days for each outq, since some outqs purge requirements are different.

We determined the we could use outq field USRDFNOPT , User defined option . . . . . . '999 ' to hold this value.

45 days was our default, which did NOT need to be populated,, which was common for majority.

999 - do not purge.

Other outqs had other values. (5,10,30,90)



The solution was dynamic, automatically handled outs as they were created/deleted.



0001.00 /* THIS PROGRAM WILL PURGE OUTQS */

0002.00 /**************************************************************************/

0003.00 /* NAME: OUTQPURGE */

0004.00 /* PURGE OUTQS */

0005.00 /* AUTHOR: PAUL STEINMETZ */

0006.00 /* DATE: 01/12/13 */

0007.00 /**************************************************************************/

0008.00 PGM PARM(&ACTION)

0009.00

0010.00 DCL VAR(&ACTION) TYPE(*CHAR) LEN(7)

0011.00 DCL VAR(&RCVINF) TYPE(*CHAR) LEN(1300)

0012.00 DCL VAR(&RCVLEN) TYPE(*CHAR) LEN(4)

0013.00 DCL VAR(&FORMAT) TYPE(*CHAR) LEN(8) +

0014.00 VALUE('OUTQ0200')

0015.00 DCL VAR(&APIERR) TYPE(*CHAR) LEN(16)

0016.00 DCL VAR(&ERRMSG) TYPE(*CHAR) LEN(7)

0017.00

0018.00 DCL VAR(&FILEN) TYPE(*CHAR) LEN(4) VALUE(' ')

0019.00

0020.00 DCL VAR(&RETENTION) TYPE(*CHAR) LEN(4) +

0021.00 VALUE(' ')

0022.00 DCL VAR(&RETOFFA) TYPE(*CHAR) LEN(4)

0023.00 DCL VAR(&RETOFF#) TYPE(*DEC) LEN(6 0)

0024.00 DCL VAR(&HEX0) TYPE(*CHAR) LEN(4) +

0025.00 VALUE(X'00000000')

0026.00 DCL VAR(&LIB) TYPE(*CHAR) LEN(10)

0027.00 DCL VAR(&OBJ) TYPE(*CHAR) LEN(10)

0028.00 DCL VAR(&OBJLIB) TYPE(*CHAR) LEN(20)

0029.00

0030.00 /* DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*OUTQ) +

0031.00 OUTPUT(*OUTFILE) OUTFILE(QGPL/OUTQPURGE) +

0032.00 /* Production */

0033.00

0034.00 /* DSPOBJD OBJ(GREGGD/CM_TAX) OBJTYPE(*OUTQ) +

0035.00 OUTPUT(*OUTFILE) OUTFILE(QGPL/OUTQPURGE) +

0036.00 /* test */

0037.00

0038.00 DCLF FILE(QGPL/OUTQPURGE) /* Outqs to be purged */

0039.00

0040.00 CHGVAR VAR(%BIN(&RCVLEN)) VALUE(1300)

0041.00 READ:

0042.00 /* READ FILE NAME OF OUTQS TO BE PURGED */

0043.00

0044.00 RCVF

0045.00

0046.00 MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) /* EOF */

0047.00

0048.00 CHGVAR VAR(&FILEN) VALUE('0000') /* Initialize User +

0049.00 defined option-No. of Files (Reports) */

0050.00

0051.00 CHGVAR VAR(&RETENTION) VALUE('00000') /* Initialize +

0052.00 User defined option-Retention days */

0053.00

0054.00 CHGVAR VAR(&OBJLIB) VALUE(&ODOBNM *CAT &ODLBNM) +

0055.00 /* User defined option-Purge Days */

0056.00

0057.00 CALL PGM(QSPROUTQ) PARM(&RCVINF &RCVLEN &FORMAT +

0058.00 &OBJLIB &APIERR) /* Retrieve Output Queue +

0059.00 Information (QSPROUTQ) API */

0060.00

0061.00 CHGVAR VAR(&FILEN) VALUE(%SST(&RCVINF 93 4)) /* +

0062.00 User defined option-No. fo Files +

0063.00 (Reports) in the Outq */

0064.00

0065.00 IF COND(&FILEN *EQ &HEX0) THEN(GOTO +

0066.00 CMDLBL(READ)) /* If Outq has 0 Spooled +

0067.00 Files, then skip */

0068.00

0069.00 CHGVAR VAR(&RETOFFA) VALUE(%SST(&RCVINF 1041 4)) /* +

0070.00 Offset User defined option-Purge Days */

0071.00

0072.00

0073.00 IF COND(&RETOFFA *EQ &HEX0) THEN(DO)

0074.00 CHGVAR VAR(&RETENTION) VALUE('45')

0075.00 ENDDO

0076.00 ELSE CMD(DO)

0077.00

0078.00 CHGVAR VAR(&RETOFF#) VALUE(%BIN(&RETOFFA)) /* +

0079.00 Offset User defined option-Purge Days */

0080.00

0081.00 CHGVAR VAR(&RETOFF#) VALUE(&RETOFF# +1) /* +

0082.00 Offset User defined option-Purge Days */

0083.00

0084.00 CHGVAR VAR(&RETENTION) VALUE(%SST(&RCVINF &RETOFF# +

0085.00 5)) /* User defined option-Purge Days */

0086.00

0087.00 ENDDO

0088.00

0089.00 OVRPRTF FILE(QPPGMDMP) HOLD(*YES) SAVE(*YES) +

0090.00 USRDTA(&ODOBNM)

0091.00 /* DMPCLPGM /* DUMP CL */

0092.00

0093.00 OVRPRTF FILE(TAAPRT1) OUTQ(TAATOOL/TAAOUTQ) +

0094.00 HOLD(*YES) SAVE(*YES) USRDTA(&ODOBNM)

0095.00

0096.00 IF COND(&RETENTION *EQ '999 ') THEN(GOTO +

0097.00 CMDLBL(READ)) /* 999 = Permanent +

0098.00 Retention- skip this outq */

0099.00

0100.00

0101.00 DLTOLDSPLF OUTQ(&ODLBNM/&ODOBNM) FILE(*ALL) USER(*ALL) +

0102.00 EXCLUDEUSR(*NONE) JOB(*ALL) +

0103.00 EXCLUDEJOB(*NONE) FORMTYPE(*ALL) +

0104.00 USRDTA(*ALL) STS(*ALL) ASPDEV(*) +

0105.00 RETAINDAYS(&RETENTION) QPJOBLOG(999) +

0106.00 QPSRVDMP(999) MOVTOOUTQ(*LIBL/*NONE) +

0107.00 ACTION(&ACTION) COMPDATE(*CRTDAT) +

0108.00 SUMMARY(*YES)

0109.00 MONMSG MSGID(CPF0001 CPF9999) EXEC(GOTO CMDLBL(READ))

0110.00

0111.00 GOTO CMDLBL(READ)

0112.00

0113.00 /* DMPCLPGM /* DUMP CL */

0114.00

0115.00 END: ENDPGM



Paul







-----Original Message-----

From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Thomas Burrows

Sent: Wednesday, March 20, 2019 7:44 PM

To: RPG programming on IBM i

Subject: Re: help deleting spool files



Would like to clean up a massive amount of spool file - 15K - plus with the

job name being the big difference.



On Wed, Mar 20, 2019 at 6:13 PM Craig Richards <craig@xxxxxxxxxxxxxxxx>

wrote:



Hi Thomas,



There are a few different solutions mentioned by different people in this

post so I'm not sure which program you are asking to share - which fits

your need best?



My own program was written a long time ago and mostly just to clean up my

own spool.

I use it as described in my first response.

The parameters allow me to specify a user profile and an OUTQ but mostly I

let it default to my own profile and ALL out queues.

It runs fast. I'm in the habit of using it frequently throughout the day as

I work.



You mention that you are trying to clean up job log files but I'm not sure

what selection parameters you want to apply.

E.g User that created the spool or age of the spooled file?

Could you potentially just clear a single OUTQ?



The DLTSPLF command needs:



- Spooled File Name

- Spooled File Number

- Qualified Job Name (Name, User and Nbr)



Depending on what version of the OS you are on, this information is easily

retrievable via the DB2 Services as described in the above posts -

certainly easier to get at than using the QUSLSPL Api.



However when I tried to use the OUTPUT_QUEUE_ENTRIES view using selection

of only USER_NAME it was very slow.

This probably wouldn't matter to you if you were just running something in

a JOBSCDE overnight etc but it wouldn't work for me as I use my utility

frequently throughout the day to get rid of my spool from compiles and

joblogs etc.



My utility is not just a standalone program though, it requires a service

program I wrote to perform all of the user space processing - creating the

space, retrieving the standard header to find where the list starts etc.



What is your criteria for deleting the job logs (what selection parameters)

and when/how do you see it being used?



regards,

Craig







On Wed, 20 Mar 2019 at 21:25, Thomas Burrows <

thomas.burrows.1957@xxxxxxxxx>

wrote:



Could you share the program? Could send a gift card if that would help.



On Wed, Mar 20, 2019 at 8:50 AM (WalzCraft) Jerry Forss <

JForss@xxxxxxxxxxxxx> wrote:



When I started here there were over 230,000 spool files on the system.

Nothing was ever cleaned up and no one knew how to figure out what was

there.



We had an incident where payroll spool files were left. Someone saw

them

and tried to get raise. Person no longer here.



I wrote a spool manager that decides what should happen to each spool

file

the moment it is created. The processes include archiving it to the IFS

(takes 10% of the space), emailing the report and deleting it. After it

is

in the IFS for say 90 days for job logs, it is deleted.



Now spool files are on the IBMi in that format for only a second.



The basics are CrtDtaQ and AddEnvVar to add entry to DtaQ when spool

file

is created. I have a pgm that monitors the DataQ.



Works extremely well here.





-----Original Message-----

From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of

Thomas

Burrows

Sent: Tuesday, March 19, 2019 4:49 PM

To: RPG programming on the IBM i (AS/400 and iSeries) <

rpg400-l@xxxxxxxxxxxxxxxxxx>

Subject: help deleting spool files



When doing a DLTSPLF I cannot figure out a way to input the changing

USER

DATA or JOB from the spool file information. I can give my six

character

number a starting point and then increment. With a stopping point.



But how would I delete a mass of say joblogs that being dumped into a

spool file everyday to hold down on system space.







Subject to Change Notice:



WalzCraft reserves the right to improve designs, and to change

specifications without notice.



Confidentiality Notice:



This message and any attachments may contain confidential and

privileged

information that is protected by law. The information contained herein

is

transmitted for the sole use of the intended recipient(s) and should

"only"

pertain to "WalzCraft" company matters. If you are not the intended

recipient or designated agent of the recipient of such information, you

are

hereby notified that any use, dissemination, copying or retention of

this

email or the information contained herein is strictly prohibited and

may

subject you to penalties under federal and/or state law. If you

received

this email in error, please notify the sender immediately and

permanently

delete this email. Thank You



WalzCraft PO Box 1748 La Crosse, WI, 54602-1748

www.walzcraft.com<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.walzcraft.com&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=d3cNw3KlAkUnPlo0vmplH_P1AEDQ59t-DcYFPsXIEuk&e=> Phone: 1-800-237-1326

--

This is the RPG programming on IBM i (RPG400-L) mailing list

To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=djW3OmRBjXb1MmeuXaGHySqb-N6pGiQMAVayiDrv78Q&e=

or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=qjFFUznCX-parrzpcFBPcwsGAYb3F4UFx7VcCPR0xrU&e=.



Please contact support@xxxxxxxxxxxx for any subscription related

questions.



Help support midrange.com by shopping at amazon.com with our affiliate

link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=5VTuikW_-vYLOi6bTg0PPHBun4KNtvJ4qKtkF9FNjCU&e=



--

This is the RPG programming on IBM i (RPG400-L) mailing list

To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=djW3OmRBjXb1MmeuXaGHySqb-N6pGiQMAVayiDrv78Q&e=

or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=qjFFUznCX-parrzpcFBPcwsGAYb3F4UFx7VcCPR0xrU&e=.



Please contact support@xxxxxxxxxxxx for any subscription related

questions.



Help support midrange.com by shopping at amazon.com with our affiliate

link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=5VTuikW_-vYLOi6bTg0PPHBun4KNtvJ4qKtkF9FNjCU&e=



--

This is the RPG programming on IBM i (RPG400-L) mailing list

To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx

To subscribe, unsubscribe, or change list options,

visit: https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=djW3OmRBjXb1MmeuXaGHySqb-N6pGiQMAVayiDrv78Q&e=

or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx

Before posting, please take a moment to review the archives

at https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_rpg400-2Dl&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=qjFFUznCX-parrzpcFBPcwsGAYb3F4UFx7VcCPR0xrU&e=.



Please contact support@xxxxxxxxxxxx for any subscription related

questions.



Help support midrange.com by shopping at amazon.com with our affiliate

link: https://urldefense.proofpoint.com/v2/url?u=https-3A__amazon.midrange.com&d=DwICAg&c=Iej4I5bEYPmgv5l2sS6i8A&r=XeGBz1fvL6mzoxSW9-Fyt7Ajo0tG_mOKUz5KbIaikfo&m=u_G1FWPL0V_Jecl9ZBfIxOsrXepoK3CsMW0VUZwusE0&s=5VTuikW_-vYLOi6bTg0PPHBun4KNtvJ4qKtkF9FNjCU&e=




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.