I have written this program since i hwanted only those spooled files to be deleted whose status is either HLD
OR RLS.
and I don’t think without a program this could have been possible.
following command will delete all spool files for user JKJK
DLTSPLF FILE(*SELECT) SELECT(JKJK)
but what if i want to
delete only those whose staus is either HLD or RDY.
Please correct me if tit could also have been done in other way or in other programming approach or through some other
logic without creation of Logical file and flat file.
Thanks
Discuss This Question: 38  Replies
if (%sst(&SPNO 1 1) *eq ' ') then(chgvar %sst(&SPNO 1 1) '0')
...in IF condition how to fix it if *AND taking precedence over *OR. You fix that the way I put in my previous comment. Put the extra parentheses into the condition just like I showed. Tom0003.01 SPNO I SST(N12 103 3)
You have SPNO starting in 103, and that matches what I have on my i 6.1 system. But the field is 4 characters long, and you are defining it as 3 long. If you only want 3 characters, you need to move your starting position over to 104. If you start at 103 and use a 4 character field, you will also need to check for one more blank. TomIF COND( (&USER *EQ JKJK *or &USER *EQ ABC) *AND +(&STS *EQ HLD *OR &STS *EQ RDY)) THEN(DO)
You need the *OR test for &USER, and that test needs its own set of parentheses. Your WRKSPLF needs to be this way:WRKSPLF OUTPUT(*PRINT)
The command works in batch because it defaults to *PRINT in batch. It defaults to the display when run interactively, so you need to tell it to print. (There is no display in batch.) I remember that the spool file name had an extra blank when I ran my test, but forgot to mention it. It's better that you found it on your own, though. It shows that you are learning how to debug and how to find the smallest details. Good job. TomDLTSPLF FILE(*SELECT) SELECT(JKJK)
Tomone more question in same regard like:-
This program deletes all the spool file to specfic user and if we want to add one more condition like 1) delete spool file of specific job and in to this specific user whose status is either HLD or RDY.
also whats the difference between deleting spooled files along with that specific job
and manually deleting the spooled files of specific job and specific user which after deleting shows status as 'FIN'.
where as if we delete them through dltsplf whole job it self along with specific user gets deleted
where as if we delete them through dltsplf whole job it self along with specific user gets deleted
The "specific user" will never be deleted by running DLTSPLF. The "whole job" will be deleted only if the job has ended and all spooled files are deleted.
That is the same way it works when manually deleting spooled files. There is no difference in how the two ways work.
If the job is still active, the list of spooled files for the job will show status 'FIN' for a deleted spooled file. That status will remain until the job ends.
Tom
One more thing--> why does that specific job not end even if all the spooled files after deleting manually shows in 'FIN' status.here some times job is ended after deleting all the spooled files under it and some times it keeps showing it's all spooled files as 'FIN' status.
in what scenarios system behave like this?
A job doesn't end simply because all spooled files are deleted. But if a job has previously been ended, it will be removed from the system after all spooled output has been deleted. An active job can have all of its spooled files deleted. That doesn't end the job.
There can be conditions when a system takes excessive time to remove a job. A job might be in an abnormal state and be unable to end. In such a case, only IBM would know what the cause was.
The most common reason that I see id simply a very large external message queue. It takes time for the system to clear the space and release all resources. That shouldn't take more than a few minutes even on a slow system.
There is at least one exception. If a job is named QPRTJOB, you should expect it to take at least 24 hours before the system removes it. The system will keep those jobs around in case new spooled files will become attached to them. Those are jobs that are defined to hold "detached" spooled for users.
Tom
...along with new job number and with same specific user and same job(QPRTJOB).
So after 24 hours (the exception job) QPRTJOB and that specific user and a new job number will be generated by the system that will show old ones as deleted means in 'FIN' status and newly attached(after 24hours) status under this (QPRTJOB) either 'HLD' or 'RDY' right?
So only QPRTJOB is the job which even after deleting all it's spooled files(up to 24 hours) will be available in system (with same job name(QPRTJOB) AND THAT SPECIFIC USER(WHOSE SPOOLED FILE WE WANT TO DELETE THROUGH PROGRAM AND AS DISCUSSED ABOVE) and with same job number will be available just up to 24 hours ever since it's spooled files were and will show deleted spooled files(either manually or prgramatically) as 'FIN' and after 24 hours just job number will be changed and job name (QPRTJOB) Job user name(that specific user) will remain same only new Job number will be introduced by system.So that newly created spooled files either as HLD or RDY could be atached here...right?
Thanks
..Also how does this QPRTJOB enters in the system and for how long does it show old deleted spooled files(either manually or through programatically) as 'FIN' .
Accepted that new job enters(only Job number gets changed) in system which keeps spooled files generated in the system either as HLD or RDY but what is the time limit for the old spooled files which have been deleted(manually or programatically) to be shown in 'FIN' status along with newly attached with it(eith HLD or RDY) means how long(days/months/years) will the system show old deleted spooled files in 'FIN' status.?
Thanks
...how long(days/months/years) will the system show old deleted spooled files in 'FIN' status.?
I don't know if that's documented anywhere. I have a few old FIN entries in one QPRTJOB, but there's no way to tell how old those entries are. Once the file is deleted, the attributes of the file are no longer available. I would first guess that old entries might be cleaned up after an IPL, but it will be a while before I can test that.
If you need an authoritative answer, you might need to call IBM and ask. Otherwise, you might simply watch some entries to see how long they last.
Why does it matter?
Tom