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

     

Obscure Commands

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.

Have you ever wanted to get a quick file count from a group or an account? Usually I do something like the following:

SETVAR KOUNT=0
REPEAT
SETVAR KOUNT=KOUNT+1
FORFILES @.@.ACCOUNT
ECHO !KOUNT

This is actually pretty slow, and includes a fair bit of typing. I found out about an undocumented function the other day that makes this task a lot easier.

CALC FCOUNT(‘@.@.ACCOUNT’)

This works very quickly and displays the file account of the file set.

Here is a documented command that I stumbled across the other day, PAUSEJOB, and its companion command, SHOWPAUSED.

Syntax: %PAUSEJOB “[{time|booleanexpression}]” , userset
[;VERIFY|NOVERIFY|QUIET]
[;scheduleparms]
[;CHECKEVERY=minutes]

%SHOWPAUSED

Examples:

%PAUSEJOB “5:30PM”, #J123
%PAUSEJOB “11:00PM”, COMPILE,@.@; NOVERIFY
%PAUSEJOB “JSCOUNT(‘@,REPORT.@&EXEC’)<=3”, REPORT,@.@ %PAUSEJOB , #J987; IN=0,0,120

The %PAUSEJOB command allows you to SUSPEND (via the :BREAKJOB command) a particular job or jobset (using VESOFT usersets), and have MPEX automatically RESUME the job at a specified future time or when a given expression becomes true.

The syntax for %PAUSEJOB is quite similar to %ALARM. In fact, you must have the ALARM task running under the BACKG job in order for %PAUSEJOB to be able to RESUME the job later. For this reason, if you issue a %PAUSEJOB command and the BACKG job is not already running, MPEX will attempt to start it for you.

You may tell %PAUSEJOB to RESUME the suspended job:

• at a particular future time (e.g. “5:30 PM”);
• when a particular Boolean expression becomes true (e.g. “JSCOUNT(‘COMPILE,@.@’)<=3”); or
• using the MPE :STREAM-style scheduling parameters ;AT=, ;DAY=, ;DATE=, and ;IN= (e.g. “;IN=0,0,5” or “;DATE=11/05/91;AT=9:00”).

If you specify a jobset (rather than a single job), %PAUSEJOB will list all of the jobs that will be affected and ask:

OK to process these jobs (y/n)?

If you don’t want to be asked, use the ;NOVERIFY keyword. If you don’t even want %PAUSEJOB to list the jobs that it processes, use the ;QUIET keyword (which implies ;NOVERIFY).
PERFORMANCE CONSIDERATIONS (;CHECKEVERY=)

By default, the ALARM background task wakes up once per minute to see if any of the %PAUSEJOB conditions have been met. If you set a %PAUSEJOB alarm based on an expression that will use a lot of system resources to evaluate, you may want to check that particular alarm less frequently.

When you enter a %PAUSEJOB command, simply append the ;CHECKEVERY= keyword to tell the ALARM background task how many intervals to skip between tests. For example:

%PAUSEJOB “JSCOUNT(‘COMPILE,@.@&EXEC’)=0”, #J115; CHECKEVERY=10

This means “:BREAKJOB #J115, and when there are no more jobs executing that logged on with a jobname of COMPILE, :RESUMEJOB #J115.” Since the default pause time is one minute, this will wait 10 minutes between tests. If you have the pause time of %ALARM set to a value other than 1 minute, then this will vary. If it is set to two minutes, then this expression would wait 20 minutes between tests.

Next time we will cover some other obscure commands, but in future columns I’m going to demonstrate some oddball applications that you can write in just a few lines of MPEX command file code.

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.