Page 1 of 1

Debugging REXX programs like the COBOL programs.

Posted: Wed Feb 03, 2016 3:33 pm
by Pathi Kumar
Hi,

I am a COBOL programmer and an ok programmer in this language. So I understand it to a better extent than other languages. I am learning REXX now and I am pretty new to REXX. I was thinking if there is any way we can debug REXX codes like we can do the COBOL code using XPEDITOR or IBM DEBUG tool.

Please guide.

Thanks,

Re: Debugging REXX programs like the COBOL programs.

Posted: Wed Feb 03, 2016 3:38 pm
by enrico-sorichetti
look at the wonders of the TRACE command

Re: Debugging REXX programs like the COBOL programs.

Posted: Wed Feb 03, 2016 11:13 pm
by zprogrammer
I double Enrico said there are plenty of options along with Trace...

Re: Debugging REXX programs like the COBOL programs.

Posted: Fri Feb 05, 2016 10:16 pm
by prino
And you don't even have to change your source if you do a

Code: Select all

TSO EXECUTIL TS
before invoking the code...

Re: Debugging REXX programs like the COBOL programs.

Posted: Mon Feb 08, 2016 11:57 am
by Pathi Kumar
enrico-sorichetti wrote:look at the wonders of the TRACE command


Thanks enrico-sorichetti. I looked at this link http://publibz.boulder.ibm.com/cgi-bin/ ... #SPTREF313 and found it very useful:
TRACE controls the tracing action (that is, how much is displayed to the user) during processing of a REXX program. (Tracing describes some or all of the clauses in a program, producing descriptions of clauses as they are processed.) TRACE is mainly used for debugging. Its syntax is more concise than that of other REXX instructions because TRACE is usually entered manually during interactive debugging. (This is a form of tracing in which the user can interact with the language processor while the program is running.) For this use, economy of key strokes is especially convenient.
If specified, the number must be a whole number.

The string or expression evaluates to:

A numeric option
One of the valid prefix or alphabetic character (word) options described later
Null
The symbol is taken as a constant, and is, therefore:
A numeric option
One of the valid prefix or alphabetic character (word) options described later
The option that follows TRACE or the result of evaluating expression determines the tracing action. You can omit the subkeyword VALUE if expression does not begin with a symbol or a literal string (that is, if it starts with a special character, such as an operator or parenthesis).

Re: Debugging REXX programs like the COBOL programs.

Posted: Mon Feb 08, 2016 12:19 pm
by Pathi Kumar
I also find this text very useful: http://publibz.boulder.ibm.com/cgi-bin/ ... 2#HDRDEBUG
11.0 Chapter 11. Debug Aids


In addition to the TRACE instruction, (see 3.23) there are the following debug aids:

The interactive debug facility
The TSO/E REXX immediate commands:
HE -- Halt Execution
HI -- Halt Interpretation
TS -- Trace Start
TE -- Trace End
You can use the immediate commands if a REXX exec is running in the TSO/E address space and you press the attention interrupt key. In attention mode, you can enter HE, HI, TS, or TE. You can also use the TS and TE immediate commands in a REXX exec that runs in any address space. That is, TS and TE are available from both ADDRESS MVS and ADDRESS TSO.
The TSO/E REXX command EXECUTIL with the following operands:
HI -- Halt Interpretation
TS -- Trace Start
TE -- Trace End
You can use the EXECUTIL command in an exec that runs in the TSO/E address space. You can also use EXECUTIL from TSO/E READY mode and ISPF and in a TSO/E CLIST. You can use EXECUTIL with the HI, TS, or TE operands in a program written in a high-level programming language using the TSO service facility. See "EXECUTIL" in topic 10.4 for more information.
The trace and execution control routine IRXIC. You can invoke IRXIC from a REXX exec or any program that runs in any address space to use the following TSO/E REXX immediate commands:
HI -- Halt Interpretation
TS -- Trace Start
TE -- Trace End
HT -- Halt Typing
RT -- Resume Typing