Thanks for your advice.
I tried redirecting STDERR to a separate file, and the output from "tso
allocate..." and "tso oget..." does indeed go to the
STDERR file instead of STDOUT.          

Am I using the commands correctly?

I am coding the TSO commands within backticks, so that they will be passed
to the UNIX Operating system.
I am not setting a variable with them, or checking return code, so maybe I
should?

i.e. a line from my script is:

`tso -t "allocate dataset('id03l.${dsnhlq}.${logfile}.${weekday}') new"`

Again, the command is executed okay, it's just where does the output go.  
Even if I am executing incorrectly it still seems bizarre that they do not
appear in the same order in STDOUT as they do on the screen.  This still
seems to be a problem.  Am I out of line here?

Thanks again,
Beth Rice

> ----------
> From:         [EMAIL PROTECTED][SMTP:[EMAIL PROTECTED]]
> Sent:         Monday, June 24, 2002 9:58 AM
> To:   Rice, Elizabeth A.
> Cc:   [EMAIL PROTECTED]
> Subject:      Re: Redirected output to file incorrect with TSO commands in
> script
> 
> 
> Elizabeth Rice wrote:
> !I am using a few TSO commands in my Perl script.
> !
> !When I let the output from my script go to the terminal it comes out on
> the
> !terminal in the order that it is producted.
> !When I redirect the output to a file all the TSO ouput is at the top, and
> my
> !print statements follow in order.
> !
> !Is this an error in Perl on MVS or in the UNIX Shell on MVS?
> 
> Well you've notices a difference between the output of:
> 
> SYSM $ perl -w olaplog.pl
> 
> as opposed to:
> 
> SYSM $ perl -w olaplog.pl > olaplog.pl.out 2>&1
> 
> where the difference is directing output to a file and duplicating
> error output to the same file.  This falls within the realm of
> a difference in shell command so strictly speaking the answer is
> it is not perl's fault.
> 
> That is not to that ther might not be somethings you could try playing
> with in perl to help overcome the shell's or tso's dual behavior.  One
> thing to be suspicious of is which file stream is being written to.
> A way to test that would be:
> 
> SYSM $ perl -w olaplog.pl > olaplog.pl.out 2> olaplog.pl.err
> 
> and see if there is anything in the olaplog.pl.err file.
> Another things to try is duping stderr to stdout within the
> script explcitly, changing:
> 
>     print `tso $cmd`;
> 
> to something along the lines of:
> 
>     print `tso $cmd 2>&1`;
> 
> I hope that helps.
> 
> Peter Prymmer
> 
> 
> 
> 

Reply via email to