| Front Page | News Headlines | Technical Headlines | Planning Features | Advanced Search |
Speedware Sponsor Message

     

Spool file management

By Shawn M. Gordon

Inside VESOFT covers tips and techniques you can use with VESOFT’s products, especially MPEX. As always, I am totally open to getting input from you users of MPEX, Security/3000 or VEAudit/3000 — it helps me learn, too. Send me your tricks, and we’ll get a “3000 for 2000” cap out to you as our thanks.

Ever since spool files became semi-normal files in MPE/XL 2.2, and Spook disappeared, people have been coming up with all sorts of UDCs and command files to tweak useful information out of the SPOOLF and LISTSPF commands. Of course there is SPOOKNM and SPIFF if you are still missing the old SPOOK syntax.

In any case, MPEX quickly rose to the challenge and implemented all sorts of nifty commands and file objects to manage spool files a number of years ago, but many people are still unaware of the bulk of them. So as is the purpose of this column, we will spend some time going over them, so you have even more tools at your disposal.

So first, the most common command would be SHOWOUT.

Syntax: %SHOWOUT spoolfileset[;listfile]
Examples:
%SHOWOUT $STDLIST.@.@
%SHOWOUT @.@.PROD(SPOOL.JSNAME=”COMP010”)
%SHOWOUT @.@.@(SPOOL.OUTPRI>=5)

What you will notice is the (SPOOL.????) Syntax. This is how you select the spool attribute variables that you are going to want to work on. These will apply to SHOWOUT, ALTSPOOLFILE and DELETESPOOLFILE. There is an accessible attribute for virtually any spool file characteristic that you can name. I’m not going to regurgitate them here, you can see them explained very clearly in the manual.

The output from SHOWOUT looks like the sample that follows.

%showout $stdlist.@.@
MPEX %SHOWOUT $stdlist.@.@ PAGE 1
SYSTEM SERIES 957 MANAGER.SYS,PUB WED, MAY 17, 2000, 12:52 PM
SPFile# Filename Pri JOB#:jobname,user.account,group Ready Date
#O99 $STDLIST 8 #J’3:FTPMON,FTP.SYS 02MAR 1:31PM
#O98 $STDLIST 8 #J’2:JINETD,MANAGER.SYS 02MAR 1:31PM
#O106 $STDLIST 8 #J’3:FTPMON,FTP.SYS 17MAR 6:42AM
#O117 $STDLIST 8 #J’3:FTPMON,FTP.SYS 17MAR 1:37PM
#O116 $STDLIST 8 #J’2:JINETD,MANAGER.SYS 17MAR 1:37PM
#O124 $STDLIST 8 #J’3:FTPMON,FTP.SYS 21MAR 10:46AM
#O123 $STDLIST 8 #J’2:JINETD,MANAGER.SYS 21MAR 10:46AM

A related command is SHOWOUTJ, which is really a special purpose version of SHOWOUT. It was originally implemented in VESOFT tech support back when I was working there (but not by me). The idea behind SHOWOUTJ is to make it easy to identify all of the spoolfiles generated by a particular logon.

Syntax: %SHOWOUTJ [jobsessionname][,user.account]
Examples: %SHOWOUTJ BACKMAN,@.SMGA
%SHOWOUTJ XXX is the same as %SHOWOUTJ XXX,@.@
%SHOWOUTJ ,USER.ACCT is the same as %SHOWOUTJ @,USER.ACCT
So %SHOWOUTJ X@,Y@.Z@ is the same as saying
%SHOWOUT @.@.Z@ (SPOOL.JSNAME MATCHES “X@” and SPOOL.USER MATCHES “Y@”)

Here is a quick example of deleting all the $STDLIST files that have been sitting around for a week.
%deletespoolfile $stdlist.@.@(spool.readydate < today-7)
——-Deleting #O99, $STDLIST, #J’3, FTPMON,FTP.SYS (16 sectors)
——-Deleting #O98, $STDLIST, #J’2, JINETD,MANAGER.SYS (16 sectors)
——-Deleting #O106, $STDLIST, #J’3, FTPMON,FTP.SYS (16 sectors)
——-Deleting #O117, $STDLIST, #J’3, FTPMON,FTP.SYS (16 sectors)

And of course ALTSPOOLFILE will work in a similar fashion.

Now to the bit that is the most confusing to me, and that is working on spool files in a REPEAT..FORFILES loop. It’s just confusing because you have to add a couple of extra pieces of information, and the MPEXCURRENTFILE variable will contain the DFID string: something like “#O1234” instead of the standard FILE.GROUP.ACCOUNT that you are used to.

The format of the REPEAT..FORFILES loop is pretty much the same as you are used to except for some additions to the FORFILES directive. So something like this:

%REPEAT
...
%>FORFILES $STDLIST.@.@(SPOOL.OUTPRI=1):SPOOL

Here we would operate on all the $STDLIST files with a priority of 1. You will notice the “:SPOOL” at the end: this is critical so that MPEX knows where to look for the fileset. Inside the REPEAT loop you access the spool attribute values as “SPOOL.attr” instead of the familiar “RFILE.attr.” So for example, if I wanted to display the MPE user ID of the creator of the $STDLIST then I would say ECHO ![SPOOL.USER].

There are some fun and interesting possibilities with the MPEX spooler interface, and some advantages over third party spoolers. Most, if not all, third party spoolers will redirect various SPOOLF and LISTSPF commands into a temp file and massage the output for you. In some cases the number of spool files that qualify is larger than the temp file they create, and you have problems. MPEX doesn’t seem to have this problem.

A case in point: I had a situation where some unknown program was generating tens of thousands of empty spool files a day, each with only one or two blank lines in it. If the background process in our third party spooler came down for more than an hour or so, it couldn’t purge the files anymore because too many qualified. I converted this to an MPEX DELETESPOOLFILE command and we never had any more trouble with it, and it had lower overhead. The reason we had all these empty spool files is another story, for another day.

Shawn Gordon, whose S.M. Gordon & Associates firm supplies HP 3000 utilities, has worked with 3000s since 1983. 


Copyright The 3000 NewsWire. All rights reserved.