Skip to content

Instantly share code, notes, and snippets.

View alanseiden's full-sized avatar

Alan Seiden alanseiden

View GitHub Profile
You can add the command below to the evening job stream that later allocates/clears the file. The command will ask any jobs having locks to release those locks. In my experience, this has worked perfectly with QSQSRVR jobs that hold *SHRRD pseudo-locks on the object.
For file MYFILE:
ALCOBJ OBJ((MYLIB/MYFILE *FILE *EXCL *N)) CONFLICT(*RQSRLS)
if a member:
ALCOBJ OBJ((MYLIB/MYFILE *FILE *EXCL MYMEMBER)) CONFLICT(*RQSRLS)
Make sure you add a MONMSG immediately after the ALCOBJ command to handle any messages such as "cannot allocate..." which may arise normally.
@alanseiden
alanseiden / spoolfinder.clp
Created November 20, 2014 17:36
CL program to identify spool file generated by the IBM i toolkit, web services, etc.
PGM PARM(&INSPLF &INJOB &INUSER &INJOBN &INSPLN +
&EXISTS)
/* Thanks to Scott Campbell and Larry Nies */
/* Incoming parms */
DCL VAR(&INSPLF) TYPE(*CHAR) LEN(10)
DCL VAR(&INJOB) TYPE(*CHAR) LEN(10)
DCL VAR(&INUSER) TYPE(*CHAR) LEN(10)
DCL VAR(&INJOBN) TYPE(*CHAR) LEN(6)