I'd like to thank everyone for their many suggestions.
WOLFGANG_KINSCHER@HP-Austria came up with a 'winning' solution
that I have adapted to our use. (Mr. Kinscher is responsible for
the clever code in Step 2). For those of you who might be interested,
I have included a copy of my new SUBMIT command file that performs
the 'flexible' stream function.
Basically, SUBMIT works are follow:
1) receives the parameter list,
2) Calls itself again with the STEP 2 argument,
3) Creates a new temporary file using File Equates and FCOPY,
4) Uses INPUT to read the 1st line from the stream file,
5) Protects the leading '!' and passes the 1st line through
the ECHO facility to evaluate the HP Variables and redirects
the output to the temporary file,
6) exits back to step 1,
7 step 1 appends the rest of the stream file (minus the now
fixed up 1st line) to the temporary stream file,
8) builds a TIMESPEC parameter if deferred streaming was wanted,
9) streams the temporary file.
Text of SUBMIT.UDC
parm _job,char='!',AT='',day='',date='', in='',_step='STEP1'
if '!_step' = 'STEP1' then
xeq !hpfile '!_job', _step='STEP2' <!_job
reset tempjob
file tempjob,oldtemp;acc=append
fcopy from=!_job;to=*tempjob;subset=1 > $null
reset tempjob
setvar timespec ' '
if '!at' > ' '
setvar timespec ';AT=' + '!AT'
endif
if '!day' > ' '
setvar timespec timespec + ';DAY=' + '!DAY'
endif
if '!date' > ' '
setvar timespec timespec + ';DATE=' + '!DATE'
endif
if '!in' > ' '
setvar timespec timespec + ';IN=' + '!IN'
endif
stream tempjob,!char !timespec
purge tempjob,temp
deletevar _l, _l1, _l2, timespec
else
if '!_step' = 'STEP2' then
file tempjob=tempjob,oldtemp
if finfo('*tempjob','exists') then
purge tempjob,temp
endif
file tempjob;temp;disc=![finfo('!_job','end of file')+1]
fcopy from=!_job;to=*tempjob;new;subset=0,0 > $null
file tempjob,oldtemp
input _l
setvar _l1 str(_l,1,1)
if _l1 = '!' then
setvar _l1 '!!'
endif
setvar _l2 str(_l,2,len(_l)-1)
setvar _l _l1 + _l2
echo !_l >>*tempjob
endif
endif
At 12:58 PM 11/8/97 -0600, Gary L. Biggs wrote:
>I'm looking for an easy way to make stream jobs that are
>usable across multiple accounts.
>
>Does anyone have any suggestions on how one might implement
>a UDC that would update a job statement in a stream file
>with the current HP environment variable settings as shown below:
>
>!job SomeJob,!HPUSER.!HPACCOUNT,!HPGROUP;pri=ES
>
>I need something that is useable at 30+ customer sites so
>third party software solutions are out.
>
>Thanx
>
>
>
>Gary L. Biggs, N5TTO
>[log in to unmask]
>Interex SIG Allbase Chair
>
>"Abandon all hope, Ye who Inter(net) here" --
>Dante, over the portal(router) to Hell
>
Gary L. Biggs, N5TTO
[log in to unmask]
Interex SIG Allbase Chair
"Abandon all hope, Ye who Inter(net) here" --
Dante, over the portal(router) to Hell
|