HP3000-L Archives

March 2003, Week 5

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Lars Appel <[log in to unmask]>
Reply To:
Lars Appel <[log in to unmask]>
Date:
Sat, 29 Mar 2003 10:27:59 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (100 lines)
Tom replied...

> Gibson Nichols wrote:
>> Can a session pass data to a job that it streams?

Strange enough, I did not see the original posting.
Did it come via the Usenet newsgroup comp.sys.hp.mpe?
I could not even see it in the Raven web pages.

Anyway, not owning MPEX or STREAMX, I would probably try
one of these two approaches... Either (a) use a template
file for the job to be streamed and replace placeholder
strings e.g. with /bin/sed before streaming it via a temp
file or somesuch, or (b) use a fixed job that evaluates
who streamed it to pick up a file parameters from it.

Idea (a):

:print j1
!job lars,manager.sys
!tell @session@ It worked :-)
!eoj

:/bin/sed "s/@session@/#!hpjobtype!hpjobnum/g" < j1 > j2

:listftemp
TEMPORARY FILES FOR MANAGER.SYS,HOME
J2.HOME.SYS

:print j2
!job lars,manager.sys
!tell #S43 It worked :-)
!eoj

:stream j2
 #J14
FROM/J14 MANAGER.SYS/It worked :-)
:

Idea (2):

:print j3
!job lars,manager.sys
!setvar sessionid, word(hpstreamedby,,3)
!setvar parmfile, "/tmp/"+rht(sessionid,len(sessionid)-1)
!input x < !parmfile
!purge !parmfile
!tell !sessionid it worked, you passed !x
!eoj

:setvar parmfile, "/tmp/!hpjobtype!hpjobnum"

:echo SOME TEXT > !parmfile

:save !parmfile

:stream j3
 #J19
FROM/J19 MANAGER.SYS/it worked, you passed SOME TEXT
:

As a slight twist of "Idea (b)", you might use echo commands to
stuff a bunch of setvar commands into the parmfile and then have
the job simply xeq it to "import" the values.

:print j4
!job lars,manager.sys
!setvar sessionid, word(hpstreamedby,,3)
!setvar parmfile, "/tmp/"+rht(sessionid,len(sessionid)-1)
!xeq !parmfile
!purge !parmfile
!tell !sessionid it worked, you passed !x
!eoj

:setvar parmfile, "/tmp/!hpjobtype!hpjobnum"

:echo setvar x "SOME TEXT" > !parmfile
:echo setvar y "not used" >> !parmfile

:save !parmfile

:stream j4
 #J20
FROM/J20 MANAGER.SYS/it worked, you passed SOME TEXT
:

The /bin/sed approach from "Idea (a)" can also be extended to use
multiple parameters. At present, I somehow prefer that approach over
the use of a separate parm file. No need to worry about having the
parm file in place until the job consumed it, how to make sure it
goes away "in time", how to make sure that it is not peeked at by
someone who should not see the parms, how to make sure it cannot be
replaced be someone else before the job starts (to fake your job into
doing something with different parms). Etc etc.

Lars.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2