Subj : A little help...
To : Sean Dennis
From : Peter Knapper
Date : Sun Apr 23 2006 01:40 pm
Hi Sean,
SD> I have this line to call Maximus/2 right now:
SD> maxp max -s%1 -b%2 -p%3 -n1 -t60 -e1 -lnode1.log
SD> The -t is for the time length for each call (forced).
SD> What I'd like to do is to write a REXX script that
SD> would determine if it's between 6 AM and 10 PM, to
SD> allow 60 minutes only and if it's between 10 PM and 6
SD> AM, to allow them the full use of their access level's
SD> time limit.
That should be pretty simple to handle with REXX, the real question is what S/W
currently "invokes" the script that calls Maximus? As long as THAT S/W uses the
native OS/2 Command Shell to handle the script, then you should be fine.
I see 2 main ways to do this -
1. Convert your Shell Script to a full REXX script. This is more work but
provids the most efficient result.
2. During the running of your current Shell Script, shell out to a NEW Rexx
Script that just runs the part needing REXX. This loads a second Command
Interpreter and can add to debugging issues but it should work...
From what you have provided so far, this is a start for option 2 -
1. Change the line that reads -
maxp max -s%1 -b%2 -p%3 -n1 -t60 -e1 -lnode1.log
to -
Call RXMaxp %1 %2 %3
And then create a NEW Script 'RXMaxp.Cmd' -
===========================================================
/* Invoke Maximus with Timestamp variable data. */
Parse Arg Sparm Bparm Pparm
Rtime = 60 /* Default Run Time value. */
If (Time() > '22:00:00') and (Time() < '06:00:00') Then Rtime = 200
cmdline = 'maxp max -s'Sparm '-b'Bparm '-p'Pparm '-n1 -t'Rtime '-e1 -
lnode1.log'
cmdline
===========================================================
Line 1 (the /* at the begining is all thats needed) MUST be there to invoke it
as a REXX script. Also, watch the line wrap when building CMDLINE. I prefer to
build the string of a command as a variable, then just execute the variable.
That way I can add debug pieces into the script to see what the line has been
built as.
A "better" appproach is to completely replace the original script with one that
does ALL the work, but we would need a lot more info about the rest of the
script to get that right.
Cheers............pk.
--- Maximus/2 3.01
* Origin: Another Good Point About OS/2 (3:772/1.10)