Then using tcsh in a batch job with the expectation of being able to
read/write allocated datasets can't ever work. I had a two step batch
job, step one allocated a new dataset and wrote some data into it. The
second step tried to sftp the data to my workstation.
Using DD://XXXX failed, since the sftp task ran in a new address space,
one without the DD allocated, and when I tried to use the actual dataset
name, dynamic allocation failed, since it was exclusively enqueued by
the other address space.
Mark Jacobs
On 12/30/13 22:03, Roger Steyn wrote:
John ,
" This talks about the _BPX_SHAREAS environment
variable. This environment variable is not mentioned anywhere in the
documentation of tcsh."
Your are right . BPX_SHAREAS cannot be used for tcsh . It is documented in USS
planning guide .
_BPX_SHAREAS
Specifies whether the spawned child process is to be run in a separate address
space from the login shell's address space or in the same address space. Use
_BPX_SHAREAS is to improve performance in the z/OSĀ® shell. The spawn callable
service uses _BPX_SHAREAS when creating child processes.
Restriction: If tcsh is your login shell, do not use BPX_SHAREAS.
YES
The child process is created on a subtask in the parent's address space. If the
request cannot be honored, the child is created in another address space.
NO
The child process is created in a new address space. NO is the default.
MUST
The child process is created on a subtask in the parent's address space. If the
request cannot be honored, the request will not complete.
On Monday, December 30, 2013 7:23 PM, John McKown
<[email protected]> wrote:
This is my take on it. I am not an expert. Nor do I have access to the
actual source code. I don't believe that tcsh will do what you want. My
reasoning is below.
In order to run a
process in the same address space, the code must use the
spawn() function. I base this assertion on
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZB1C0/2.209 ,
point #8 in the Usage Notes. This talks about the _BPX_SHAREAS environment
variable. This environment variable is not mentioned anywhere in the
documentation of tcsh.
I note that the description of the fork() function does not mention
_BPX_SHAREAS at all. I therefore conclude that a fork() will always result
in a new address space.
I note that the description of the execve() function says: "The current
process image is replaced with a new process image for the executable
file
to be run." That is, the old execution state ceases to exist. So if the
tcsh did an execve() without the fork() in order to run in the same address
space, the shell would exit after the command because the shell would have
ceased to exist. In my mind, doing a exec() is much like doing an XCTL. You
don't return from whence you came.
I notice that on this page:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZA5C0/TCSHBUINONit
states: "When a command to be executed is found not to be a built-in
command the tcsh shell attempts to execute the command via execve."
Taking these things together, I have come to the conclusion that
the tcsh
shell _most likely_ invokes non-builtin commands in the original UNIX way.
That is doing a fork() followed by an exec(). This removes the possibility
of running cozsftp in the same physical address space as the shell.
Any particular reason you wan to use tcsh? I'm just curious because I've
never read anything nice about it.
On Mon, Dec 30, 2013 at 7:19 AM, Mark Jacobs <[email protected]>wrote:
I was trying to execute a batch cozsftp command using tcsh as the shell,
and my dataset allocation (to send a file to an sftp server) kept on
failing, either with an unable to stat DD, or when I
attempted to allocate
the dynamically allocate the dataset, that allocation failed due to it
being already allocated elsewhere.
Eventually I realized that the cozsftp command was being executed in
another address space, but I was unable to figure out how to get tcsh to
execute that command in the original address space.
I eventually gave up and used the /bin/sh shell to run the batch job.
Is there a magic spell to use with tcsh to have the cozsftp command
execute in the same address space?
--
Mark Jacobs
Time Customer Service
Tampa, FL
----
The quiet ones are
the ones that change the universe...
The loud ones only take the credit.
Londo Mollari - Babylon 5
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN
--
Mark Jacobs
Time Customer Service
Tampa, FL
----
The quiet ones are the ones that change the universe...
The loud ones only take the credit.
Londo Mollari - Babylon 5
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN