HP3000-L Archives

December 1999, Week 4

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:
"Emerson, Tom # El Monte" <[log in to unmask]>
Reply To:
Emerson, Tom # El Monte
Date:
Thu, 23 Dec 1999 13:45:00 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (76 lines)
> -----Original Message-----
> From: JPS [mailto:[log in to unmask]]
>
> Does anyone know a ci command to do export.
>
> In shell, it's easy
> export variable
>
> But in Mpeix ?

SETVAR is the MPE/iX command for setting a job/session (local) variable.  I
say "local" somewhat loosely here -- these variables are "global" to your
entire job or session, and by extension, are automatically "available" to
any sub-processes within your process tree.  There are some more-or-less
"global" variables, better known as SYSTEM variables (things like your
HPSUSAN, HPCPU, etc.)

> How to transmit a variable to a job ?

Let me first ask what you mean by "a job" -- I know this can be confusing
because MPE traditionally seperates interactive and non-interactive "process
environments" into two classes: "sessions" and "jobs".  In Unix circles, a
"job" is any sub-process, even those "running" from within your session.
From the way you've worded your question, however, I'll presume you are
asking more about the Unix/posix concept of a "job".

In this case, it turns out to be quite easy -- as I mentioned in the first
paragraph, any variables you "set" with SETVAR are global to your
(interactive) session.  This means that if you set a variable at the command
prompt then run a program, that program has direct access to the variables.
Likewise, if you run the program "ci.pub.sys", which is the MPE/iX
equivalent to "sh", then THAT process also has access to the variables you
set in the "outer" level process.

HOWEVER, the "posix" shell (/bin/sh, linked to SH.HPBIN.SYS) DOES follow the
"unix" way of dealing with "process local" variables, hence the need for
"export <varname>".  I doen't have a lot of experience with this, so you're
on your own for this.

If, however, you are asking about "how do I get information from a user at
an interactive session to a non-interactive JOB", which is what a long-time
MPE user would interpret your question to mean, the methods are a bit more
obtuse.

first, you can directly EDIT the source of the "jobstream" before submitting
it, setting variables to "appropriate values" before it is even introduced
to the system.  Arcane and error prone, but it works...

If you need the job to (essentially) prompt the user for information while
it is running, you could use MESSAGE files to hand the data back and forth
(using combinations of print/echo to get the data from the user to the
message file and input on the job side of things to read it)  This takes
some doing and some pretty intense knowledge of how your application runs
and interacts.

For "very simple" input as the job runs, you could use the intrinsic
PRINTOPREPLY, which prints a message on the operators console and waits for
a "reply" from the operator -- the input is limited to 31 characters,
however... [and requires you to write a specific program for this]

Finally, you could get a "third-party" tool such as <plug>MPEX and/or
Streamx</plug> which has features to do all of this semi-automatically
(Streamx allows you to insert submission-time variable information into the
job without requiring you to "edit" the job each time, and MPEX allows you
command-line access to PRINTOPREPLY as well as other similar functions)

> I could make a mix of shell and mpeix, but I'm sure there is something
> better.

Tom Emerson
Sr. Systems Analyst
NDC | e COMMERCE
[log in to unmask]
626-258-4309
626-350-3832 FAX

ATOM RSS1 RSS2