Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

running osh script from netbatch

676 views
Skip to first unread message

mattg

unread,
Nov 30, 2012, 3:06:23 PM11/30/12
to
I am running a tacl script from a netbatch job which in turn runs an oss script.

osh -p <scriptname>

This works fine from the command line but from netbatch I am getting the following error:

\CERT.$:0:1887:95091364 - *** Run-time Error 060 *** J_
\CERT.$:0:1887:95091364 - Standard output file error (1
\CERT.$:0:1887:95091364 - Unable to open =_ZBAT_OUT J_4
\CERT.$:0:1887:95091364 - From _MAIN + %22, UC.00 J_45

I know this define is in the attachment set and I even tried hard-coding the define into the tacl before calling the osh command. What am I doing wrong? I know this should be possible.

Keith Dick

unread,
Nov 30, 2012, 4:09:56 PM11/30/12
to
Try adding "-defmode on" to the osh command. The manual seems unclear to me what the -defmode default is. If the default happens to be off in your case, that might explain what your are seeing.

TACL has a SET DEFMODE command. The manual says it is always ON when TACL starts, but perhaps Netbatch turns it off. So if the "-defmode on" in the osh command doesn't solve the problem, try turning DEFMODE on in TACL, too.

Joachim Schmitz

unread,
Dec 1, 2012, 7:30:40 AM12/1/12
to
You need the -osstty option.

Bye, Jojo

Keith Dick

unread,
Dec 1, 2012, 10:18:56 AM12/1/12
to
Thanks, Jojo, I missed the part of the error message about the standard output file. Missing -osstty certainly might be the problem. If that does not fix the problem by itself, try one or both of the options related to defmode along with the -osstty option.

Why are the error messages cut off? It might have helped me to see the whole error message.

mgri...@storedvalue.com

unread,
Dec 3, 2012, 1:18:53 PM12/3/12
to
?tacl macro
#frame

#OUTPUT Running OSH
osh /jobid 0, term $ZHOME/ -defmode on -osstty -c &
"some command" &
> /home/mgriffin/test.log 2>&1

#OUTPUT Finished OSH
#unframe

Thanks for the replies. It looks like I got through the original error. Now the netbatch job runs to completion instantly but the inside program fails. From the command line my script will run for approximately 30 seconds.

ABENDED: 0,2479
CPU time: 0:00:00.003
3: Premature process termination with fatal errors or diagnostics

Keith Dick

unread,
Dec 3, 2012, 2:15:23 PM12/3/12
to
I think we need a little more to go on than "runs to completion instantly".

Does it write nothing to /home/mgriffin/test.log? If it wrote something there, what?

Does it write anything to $ZHOME? If so, what?

If it does not write anything to either, run OSSTTY nowait before the osh command and direct its output somewhere you can find it, then specify the OSSTTY process name as the OUT file for osh, make the "some command" be something simple like ls or pwd and get rid of the output redirection. (Check the manual for exactly how to set up to use a separately run OSSTTY -- I might have the details wrong.)

If you can see the ls or pwd output from that test, then make your "some command" be your original command again, leaving the other changes to use a separately-run OSSTTY in place, and see what error message you get.

That's all the ideas I have right now.

Joachim Schmitz

unread,
Dec 4, 2012, 2:34:06 AM12/4/12
to
mgri...@storedvalue.com wrote:
> ?tacl macro
> #frame
>
> #OUTPUT Running OSH
> osh /jobid 0, term $ZHOME/ -defmode on -osstty -c &
> "some command" &

if 'some command' is really just a command, i.e. a shell-builtin, you're
stuck with OSH -c and need to have a closer look at /etc/profile and
~/.profile, maybe these do somethjing that NETBATCH doesn't like.
If however 'comm command' actually is a program or a shell script (starting
with the magic "#!/bin/sh"), you'd probably better of using OSH -p

Not sure, but the shell started by OSH -c might actually see that & (rather
than it being the line continuation sign in TACL) and run in the background
(sort of the UNIX way to run nowait).
OSH -p won't do this (as it does not start a shell).

>> /home/mgriffin/test.log 2>&1

As Keith mentioned, alreday: what's in that file?

jros...@gmail.com

unread,
Dec 5, 2012, 3:32:33 PM12/5/12
to
Netbatch is trying to find a location to put the output from your osh command.
If you give the osh command a OUT like 'osh/outv ^temp/' or 'osh/out $s.#osh/', =ZBAT_OUT won't be needed. If =ZBAT_OUT is needed (because you don't specify a out', osh won't even start and you will see results as you are describing of it 'runs to completion instantly'.

mgri...@storedvalue.com

unread,
Dec 13, 2012, 11:06:46 AM12/13/12
to
Keith and Joachim, you were right all along about -defmode on and -osstty.

?tacl macro
#frame

#OUTPUT Running OSH
add define =_ZBAT_OUT,class map,file $ZBTD
osh -defmode on -osstty &
-c "/home/mgriffin/hello"
#OUTPUT Finished OSH

#unframe

This gives me the output:

13DEC12 11:04:49 OPEN U_120,6 P_OSH \CERT.$:0:1854:177810340 J_45
13DEC12 11:04:49 OPEN U_120,6 P_OSH \CERT.$:0:1854:177810340 J_45
13DEC12 11:04:49 START U_120,6 J_45 P_OSSTTY \CERT.$Z64Y:178885797
13DEC12 11:04:49 OPEN U_120,6 P_OSSTTY \CERT.$Z64Y:178885797 J_45
13DEC12 11:04:49 OPEN U_120,6 P_OSSTTY \CERT.$Z64Y:178885797 J_45
13DEC12 11:04:49 OPEN U_120,6 P_OSSTTY \CERT.$Z64Y:178885797 J_45
13DEC12 11:04:49 START U_120,6 J_45 P_Z0001CHC \CERT.$:0:2355:177811108
13DEC12 11:04:49 START U_120,6 J_45 P_Z0000TVJ \CERT.$:0:2555:177811620
13DEC12 11:04:49 MSG Hello World (stderr) J_45 P_OSSTTY \CERT.$Z64Y:178885797

13DEC12 11:04:49 STOP CC_-12 J_45 \CERT.$:0:2355:177811108
13DEC12 11:04:49 MSG Hello World (stdout) J_45 P_OSSTTY \CERT.$Z64Y:178885797

What I missed was the add define statement in my TACL script. I made the assumption that it would come out of the attachment set and it didn't seem to.

Thanks for your help!
0 new messages