Send Trace to a File 
Author Message
 Send Trace to a File

How can I send the trace output to a file?


Sun, 10 Apr 2005 21:15:03 GMT  
 Send Trace to a File
Jerry,

<command.cmd> 2> command.trc

for example:

abcd.cmd 2> abcd.trc

will direct the trace output to the file abcd.trc.

Bertram Moshier
Oracle Certified Professional 8i DBA

http://www.bmoshier.net/bertram


Quote:
> How can I send the trace output to a file?



Mon, 11 Apr 2005 03:31:10 GMT  
 Send Trace to a File
That doesn't work. It direct the rexx output to a file, but it doesn't
affect the trace output (generated with the trace command).

Quote:
> Jerry,

> <command.cmd> 2> command.trc

> for example:

> abcd.cmd 2> abcd.trc

> will direct the trace output to the file abcd.trc.

> Bertram Moshier
> Oracle Certified Professional 8i DBA

> http://www.bmoshier.net/bertram



> > How can I send the trace output to a file?



Mon, 11 Apr 2005 10:49:59 GMT  
 Send Trace to a File
If you're talking OO-REXX (you failed to say what REXXC), you can use the
.ERROR object in the .LOCAL object to do all sorts of things, including
redirect to a file. See the second example under Other Classes -> The
Monitor Class -> Examples, but replace ouptut with error (see the .LOCAL
object).


Quote:
> How can I send the trace output to a file?



Tue, 12 Apr 2005 16:00:17 GMT  
 Send Trace to a File
Jerry,

If you do ">" you are correct.  In this case, please notice, it is "2 >" NOT
">".  At least this works for me on OS/2 Warp, MS-Windows XP, and Unix.

Bertram Moshier
Oracle Certified Professional 8i DBA

http://www.bmoshier.net/bertram


Quote:
> That doesn't work. It direct the rexx output to a file, but it doesn't
> affect the trace output (generated with the trace command).


> > Jerry,

> > <command.cmd> 2> command.trc

> > for example:

> > abcd.cmd 2> abcd.trc

> > will direct the trace output to the file abcd.trc.

> > Bertram Moshier
> > Oracle Certified Professional 8i DBA

> > http://www.bmoshier.net/bertram



> > > How can I send the trace output to a file?



Mon, 18 Apr 2005 02:09:56 GMT  
 Send Trace to a File
Jerry,

Here is an example of 2> working:

Output to the screen (Standard Out):

C:\Documents and Settings\Bertram Moshier>rexx test 2> test.trc
10/30/2002 13:18:33 TEST0001I Begin test.CMD at 13:18:33
10/30/2002 13:18:33 TEST0001I 1 - 1
10/30/2002 13:18:33 TEST0001I 2 - 3
10/30/2002 13:18:33 TEST0001I 3 - 6
10/30/2002 13:18:33 TEST0001I 4 - 10
10/30/2002 13:18:33 TEST0001I 5 - 15
10/30/2002 13:18:33 TEST0001I 6 - 21
10/30/2002 13:18:33 TEST0001I 7 - 28
10/30/2002 13:18:33 TEST0001I 8 - 36
10/30/2002 13:18:33 TEST0001I 9 - 45
10/30/2002 13:18:33 TEST0001I 10 - 55
10/30/2002 13:18:33 TEST0002I EOJ with a return code = 0   TEST.CMD at
13:18:33, duration 00:00:00

Output to the trace file (test.trc) via standard error ("2 >"):

    65 *-* a = 0
       >>>   "0"
    66 *-* do i = 1 to 10
       >>>     "1"
    67 *-*   a = a + i
       >>>     "1"
    68 *-*   call !!Say_Directed 1, 'i', i '-' a
       >>>     "1"
       >>>     "i"
       >>>     "1 - 1"
   898 *-*   !!Say_Directed:
   898 *-*   procedure expose,     (GBL.List)
   900 *-*   parse arg num, level, output_line
       >>>     "1"
       >>>     "i"
       >>>     "1 - 1"
   902 *-*   if GBL.Say_Directed.Prefix = 'yes'
       >>>     "1"
   902 *-*     then
   902 *-*       do
   903 *-*       lcode = length(GBL.Say_Directed.ModuleName)
       >>>         "TEST"
       >>>         "4"
   904 *-*       if lcode > 6
       >>>         "0"
   905 *-*       code = substr(GBL.Say_Directed.ModuleName,1,lcode) ||
right(num,4,'0') || translate(level)
       >>>         "TEST"
       >>>         "1"
       >>>         "4"
       >>>         "1"
       >>>         "4"
       >>>         "0"
       >>>         "i"
       >>>         "TEST0001I"
   906 *-*       output_line = code output_line
       >>>         "TEST0001I 1 - 1"
   907 *-*     end
   909 *-* select
   910 *-*   when GBL.Say_Directed.TimeStamp = 'time'
       >>>     "0"
   912 *-*   when GBL.Say_Directed.TimeStamp = 'date'
       >>>     "0"
   914 *-*   when GBL.Say_Directed.TimeStamp = 'both'
       >>>     "1"
   914 *-*     then
   915 *-*       output_line = substr(date('U'),1,6) ||
substr(date('S'),1,4) time() output_line
       >>>         "U"
       >>>         "10/30/02"
       >>>         "1"
       >>>         "6"
       >>>         "S"
       >>>         "20021030"
       >>>         "1"
       >>>         "4"
       >>>         "10/30/2002 13:18:33 TEST0001I 1 - 1"
   919 *-* select
   920 *-*   when GBL.Say_Directed.Console = 'file'   | ,
GBL.Say_Directed.Console = 'filenc' | ,       GBL.Say_Directed.Console =
'both'   | ,       GBL.Say_Directed.Console = 'bothnc'
       >>>     "1"
   923 *-*     then
   923 *-*       do
   924 *-*       call lineout GBL.Say_Directed.FileName,output_line
       >>>         "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>         "10/30/2002 13:18:33 TEST0001I 1 - 1"
       >>>         "0"
   926 *-*       if GBL.Say_Directed.Console = 'file' | ,
GBL.Say_Directed.Console = 'both'
       >>>         "1"
   927 *-*         then
   927 *-*           do
   928 *-*           rc = stream(GBL.Say_Directed.FileName,'C','Close')
       >>>             "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>             "C"
       >>>             "Close"
       >>>             "READY:"
   929 *-*         end
   931 *-*     if GBL.Say_Directed.Console = 'both'   | ,
GBL.Say_Directed.Console = 'bothnc'
       >>>       "1"
   932 *-*       then
   932 *-*         do
   933 *-*         say output_line
       >>>           "10/30/2002 13:18:33 TEST0001I 1 - 1"
   934 *-*       end
   935 *-* end
   941 *-* return
    69 *-* end
    66 *-* do i = 1 to 10
       >>>     "1"
       >>>     "2"
    67 *-*   a = a + i
       >>>     "3"
    68 *-*   call !!Say_Directed 1, 'i', i '-' a
       >>>     "1"
       >>>     "i"
       >>>     "2 - 3"
   898 *-*   !!Say_Directed:
   898 *-*   procedure expose,     (GBL.List)
   900 *-*   parse arg num, level, output_line
       >>>     "1"
       >>>     "i"
       >>>     "2 - 3"
   902 *-*   if GBL.Say_Directed.Prefix = 'yes'
       >>>     "1"
   902 *-*     then
   902 *-*       do
   903 *-*       lcode = length(GBL.Say_Directed.ModuleName)
       >>>         "TEST"
       >>>         "4"
   904 *-*       if lcode > 6
       >>>         "0"
   905 *-*       code = substr(GBL.Say_Directed.ModuleName,1,lcode) ||
right(num,4,'0') || translate(level)
       >>>         "TEST"
       >>>         "1"
       >>>         "4"
       >>>         "1"
       >>>         "4"
       >>>         "0"
       >>>         "i"
       >>>         "TEST0001I"
   906 *-*       output_line = code output_line
       >>>         "TEST0001I 2 - 3"
   907 *-*     end
   909 *-* select
   910 *-*   when GBL.Say_Directed.TimeStamp = 'time'
       >>>     "0"
   912 *-*   when GBL.Say_Directed.TimeStamp = 'date'
       >>>     "0"
   914 *-*   when GBL.Say_Directed.TimeStamp = 'both'
       >>>     "1"
   914 *-*     then
   915 *-*       output_line = substr(date('U'),1,6) ||
substr(date('S'),1,4) time() output_line
       >>>         "U"
       >>>         "10/30/02"
       >>>         "1"
       >>>         "6"
       >>>         "S"
       >>>         "20021030"
       >>>         "1"
       >>>         "4"
       >>>         "10/30/2002 13:18:33 TEST0001I 2 - 3"
   919 *-* select
   920 *-*   when GBL.Say_Directed.Console = 'file'   | ,
GBL.Say_Directed.Console = 'filenc' | ,       GBL.Say_Directed.Console =
'both'   | ,       GBL.Say_Directed.Console = 'bothnc'
       >>>     "1"
   923 *-*     then
   923 *-*       do
   924 *-*       call lineout GBL.Say_Directed.FileName,output_line
       >>>         "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>         "10/30/2002 13:18:33 TEST0001I 2 - 3"
       >>>         "0"
   926 *-*       if GBL.Say_Directed.Console = 'file' | ,
GBL.Say_Directed.Console = 'both'
       >>>         "1"
   927 *-*         then
   927 *-*           do
   928 *-*           rc = stream(GBL.Say_Directed.FileName,'C','Close')
       >>>             "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>             "C"
       >>>             "Close"
       >>>             "READY:"
   929 *-*         end
   931 *-*     if GBL.Say_Directed.Console = 'both'   | ,
GBL.Say_Directed.Console = 'bothnc'
       >>>       "1"
   932 *-*       then
   932 *-*         do
   933 *-*         say output_line
       >>>           "10/30/2002 13:18:33 TEST0001I 2 - 3"
   934 *-*       end
   935 *-* end
   941 *-* return
    69 *-* end
    66 *-* do i = 1 to 10
       >>>     "2"
       >>>     "3"
    67 *-*   a = a + i
       >>>     "6"
    68 *-*   call !!Say_Directed 1, 'i', i '-' a
       >>>     "1"
       >>>     "i"
       >>>     "3 - 6"
   898 *-*   !!Say_Directed:
   898 *-*   procedure expose,     (GBL.List)
   900 *-*   parse arg num, level, output_line
       >>>     "1"
       >>>     "i"
       >>>     "3 - 6"
   902 *-*   if GBL.Say_Directed.Prefix = 'yes'
       >>>     "1"
   902 *-*     then
   902 *-*       do
   903 *-*       lcode = length(GBL.Say_Directed.ModuleName)
       >>>         "TEST"
       >>>         "4"
   904 *-*       if lcode > 6
       >>>         "0"
   905 *-*       code = substr(GBL.Say_Directed.ModuleName,1,lcode) ||
right(num,4,'0') || translate(level)
       >>>         "TEST"
       >>>         "1"
       >>>         "4"
       >>>         "1"
       >>>         "4"
       >>>         "0"
       >>>         "i"
       >>>         "TEST0001I"
   906 *-*       output_line = code output_line
       >>>         "TEST0001I 3 - 6"
   907 *-*     end
   909 *-* select
   910 *-*   when GBL.Say_Directed.TimeStamp = 'time'
       >>>     "0"
   912 *-*   when GBL.Say_Directed.TimeStamp = 'date'
       >>>     "0"
   914 *-*   when GBL.Say_Directed.TimeStamp = 'both'
       >>>     "1"
   914 *-*     then
   915 *-*       output_line = substr(date('U'),1,6) ||
substr(date('S'),1,4) time() output_line
       >>>         "U"
       >>>         "10/30/02"
       >>>         "1"
       >>>         "6"
       >>>         "S"
       >>>         "20021030"
       >>>         "1"
       >>>         "4"
       >>>         "10/30/2002 13:18:33 TEST0001I 3 - 6"
   919 *-* select
   920 *-*   when GBL.Say_Directed.Console = 'file'   | ,
GBL.Say_Directed.Console = 'filenc' | ,       GBL.Say_Directed.Console =
'both'   | ,       GBL.Say_Directed.Console = 'bothnc'
       >>>     "1"
   923 *-*     then
   923 *-*       do
   924 *-*       call lineout GBL.Say_Directed.FileName,output_line
       >>>         "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>         "10/30/2002 13:18:33 TEST0001I 3 - 6"
       >>>         "0"
   926 *-*       if GBL.Say_Directed.Console = 'file' | ,
GBL.Say_Directed.Console = 'both'
       >>>         "1"
   927 *-*         then
   927 *-*           do
   928 *-*           rc = stream(GBL.Say_Directed.FileName,'C','Close')
       >>>             "C:\Documents and Settings\Bertram Moshier\test.Log"
       >>>             "C"
       >>>             "Close"
       >>>             "READY:"
   929 *-*         end
   931 *-*     if GBL.Say_Directed.Console = 'both'   | ,
GBL.Say_Directed.Console = 'bothnc'
       >>>       "1"
   932 *-*       then
   932 *-*         do
   933 *-*         say output_line
       >>>           "10/30/2002 13:18:33 TEST0001I 3 - 6"
   934 *-*       end
   935 *-* end
   941 *-* return
    69 *-* end
    66 *-* do i = 1 to 10
       >>>     "3"
       >>>     "4"
    67 *-*   a = a + i
       >>>     "10"
    68 *-*   call !!Say_Directed 1, 'i', i '-' a
       >>>     "1"
       >>>     "i"
       >>>     "4 - 10"
   898 *-*   !!Say_Directed:
   898 *-*   procedure expose,     (GBL.List)
   900 *-*   parse arg num, level, output_line
       >>>     "1"
       >>>     "i"
       >>>     "4 - 10"
   902 *-*   if GBL.Say_Directed.Prefix = 'yes'
       >>>     "1"
   902 *-*     then
   902 *-*       do
...

read more »



Mon, 18 Apr 2005 03:30:47 GMT  
 Send Trace to a File
I didn't say in my origional post, but I am using Object Rexx v 2.1.1. When
I try: rexx program 2 > a.txt, the trace comes out to the screen. I don't
see how tha could work because the '2' would be seen as an input parameter
to the rexx program.  Anyway someone gave be a solution using the Error
object.

Quote:
> Jerry,

> If you do ">" you are correct.  In this case, please notice, it is "2 >"
NOT
> ">".  At least this works for me on OS/2 Warp, MS-Windows XP, and Unix.

> Bertram Moshier
> Oracle Certified Professional 8i DBA

> http://www.bmoshier.net/bertram



> > That doesn't work. It direct the rexx output to a file, but it doesn't
> > affect the trace output (generated with the trace command).


> > > Jerry,

> > > <command.cmd> 2> command.trc

> > > for example:

> > > abcd.cmd 2> abcd.trc

> > > will direct the trace output to the file abcd.trc.

> > > Bertram Moshier
> > > Oracle Certified Professional 8i DBA

> > > http://www.bmoshier.net/bertram



> > > > How can I send the trace output to a file?



Mon, 18 Apr 2005 09:56:07 GMT  
 Send Trace to a File
I'm also using Object REXX v 2.1.1

C:\Documents and Settings\Bertram Moshier>rexx test
10/30/2002 21:29:03 TEST0001I Begin test.CMD at 21:29:03
10/30/2002 21:29:03 TEST0001I REXX Version:           OBJREXX
10/30/2002 21:29:03 TEST0001I REXX Vesion Level:      6.00
10/30/2002 21:29:03 TEST0001I REXX Version Day:       24
10/30/2002 21:29:03 TEST0001I REXX Version Month:     Apr
10/30/2002 21:29:03 TEST0001I REXX Version Year:      2002
10/30/2002 21:29:03 TEST0001I Operating System:       WindowsNT
10/30/2002 21:29:03 TEST0001I Calling Environment:    COMMAND
10/30/2002 21:29:03 TEST0001I Program Path and Name:  C:\Documents and
Settings\Bertram Moshier\test.CMD
10/30/2002 21:29:03 TEST0002I EOJ with a return code = 0   TEST.CMD at
21:29:03, duration 00:00:00

You need to put "2>" together.  If there is a blank between the two then
yes, they would be seen as input parameters.

I would be happy to help you.  Would you care to share you code with me?

Bertram Moshier
Oracle Certified Professional 8i DBA

http://www.bmoshier.net/bertram


Quote:
> I didn't say in my origional post, but I am using Object Rexx v 2.1.1.
When
> I try: rexx program 2 > a.txt, the trace comes out to the screen. I don't
> see how tha could work because the '2' would be seen as an input parameter
> to the rexx program.  Anyway someone gave be a solution using the Error
> object.


> > Jerry,

> > If you do ">" you are correct.  In this case, please notice, it is "2 >"
> NOT
> > ">".  At least this works for me on OS/2 Warp, MS-Windows XP, and Unix.

> > Bertram Moshier
> > Oracle Certified Professional 8i DBA

> > http://www.bmoshier.net/bertram



> > > That doesn't work. It direct the rexx output to a file, but it doesn't
> > > affect the trace output (generated with the trace command).


> > > > Jerry,

> > > > <command.cmd> 2> command.trc

> > > > for example:

> > > > abcd.cmd 2> abcd.trc

> > > > will direct the trace output to the file abcd.trc.

> > > > Bertram Moshier
> > > > Oracle Certified Professional 8i DBA

> > > > http://www.bmoshier.net/bertram



> > > > > How can I send the trace output to a file?



Mon, 18 Apr 2005 11:39:38 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. tk send command & trace variables

2. Expect: sending a file as one big send string

3. Expect: sending a file as one big send string

4. command traces interfere with step traces (bug?)

5. TIP #102: Change [trace list] to [trace info]

6. trace on & trace off

7. How To: Send header file for Flash object - .SWF file

8. Extracting results from trace file...

9. Trace file - how I do I get rid of it

10. TRACE Utility - Topspeed Files

11. Trace-file output Rexx / OS/2

12. Parsing a trace file

 

 
Powered by phpBB® Forum Software