Subject: | |
From: | |
Reply To: | VANCE,JEFF (HP-Cupertino,ex1) |
Date: | Tue, 8 May 2001 17:52:23 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
...
> We use Vesoft's Streamx. I'd like to be able to capture the last three
> characters in the job's hpjobname to use in the file
> equation. So that, if
> the job's name is JTRA810, I would have a file equation like this:
> !file print1=TRA810;dev=lp
...
> I'd like to be able to edit just one file that contained this file
equation,
> but which also gets the last 3 charaters of the job's hpjobname.
Seems like a worthwhile improvement from a supportability perspective.
I am not a STREAMX user so there may be much easier ways to do this;
however below would be my approach (btw, not tested at all):
1. One time only: change each job file to execute a file equation script.
E.g.:
!JOB JOBNAME,USER.ACCT;...
!# initial comments
!xeq feq.scripts.sys
!...
2. The FEQ script will parse out the last 3 bytes of the job name and search
a file of all possible file equations. Note: it may be OK to just use all
possible file equations for each job, but I am assuming that there is a
conflict if you do this.
3. The FEQ script can look something like this:
# using jobname execute file equations that are appropriate
setvar feq_match rht(hpjobname,3)
if len(feq_match) < 3 then
echo Invalid JOBNAME: "!hpjobname"
return
endif
setvar feq_file "NameOfYourFileEq File"
if not finfo(feq_file,"exists") then
echo FEQ file "!feq_file" missing
return
endif
# search for matches
file feqtmp;msg
xeq grep.hpbin.sys "-i !feq_match !feq_file" >*feqtmp
# read grep output and apply each matching file eq
setvar eof finfo("*feqtmp","eof")
while setvar(eof,eof-1) >= 0 do
# execute each record in the feqtmp file
input feq_cmd <*feqtmp
!feq_cmd
endwhile
listeq
...
4. An alternative is to create an account level UDC that execute the FEQ
script
above. An advantage to this is that you don't need to change each job as I
describe in step 1. However, it is likely you will need to change each job
once anyway, if for no other reason than to delete all of the pertinent file
equations.
HTH,
Jeff Vance, CSY
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|