TN3270 DEBUG Syntax

From m204wiki
Jump to navigation Jump to search

The  TN3270 DEBUG command can be issued from the Model 204 command prompt or in a procedure:

TN3270 DEBUG {ON|OFF|WAIT|SUSPEND|RESUME|CLIENTCOMMAND|STATUS}

TN3270 DEBUG ON

To initiate a TN3270 Debugger session from the mainframe, you issue TN3270 DEBUG ON from the Model 204 command prompt or within a BATCH2 input stream or procedure. The command requires the parameters described below that identify the network ports and the workstation used in your debugging session. The values of these parameters are established during product installation:

TN3270 DEBUG ON [janClientPort] [pcHost] [pcPort] [workerPort]

where:

janClientPort The name of the Janus client socket port that is defined for the TN3270 Debugger to use to contact the Debugger Client workstation.

The default value is an asterisk (*), which means to use a Janus port whose definition includes the MASTER parameter. Such a port can be accessed on a Debugger connection request without specifying its port name on the TN3270 DEBUG ON command.

This port must be started.

pcHost

The workstation running the Debugger Client. This may be an IP number or a DNS name, as described during product installation.

The default value is a period (.), which means to use the IP address of the machine from which the TN3270 session was initiated.

pcPort

The workstation port number on which the Debugger Client is listening. As described during product installation, this is typically 8081.

The Model 204 User 0 parameter SDEBGUIP sets the default value of this port. Valid values for this parameter, which is also resettable by the system manager, range from 0 to 65535. If 0, no default is set, and the parameter's value must be explicitly specified in the TN3270 DEBUG ON command. A VIEW SDEBGUIP command returns the current setting of SDEBGUIP.

Note: As shown in an example below, to omit an explicit specification of pcPort (letting it default to the setting of SDEBGUIP) but still provide an explicit value for workerPort, use an asterisk (*) for the missing pcPort specification to indicate the respective position of the parameter values.

workerPort

The port number in your Online that is defined for worker threads. This can be the same port number that provides worker threads for the Janus Debugger, as well.

The Model 204 User 0 parameter SDEBWRKP sets the default value of this port. Valid values for this parameter, which is also resettable by the system manager, range from 0 to 65535. If 0, no default is set, and the parameter's value must be explicitly specified in the TN3270 DEBUG ON command. A VIEW SDEBWRKP command returns the current setting of SDEBWRKP.


For example:

TN3270 DEBUG ON DEBCLIENT 198.242.244.235 8081 3226

After issuing the command, you receive a message similar to this:

*** MSIR.0915: Debugging is on; client is 198.242.244.235 port 8081,      sessionID: 00000069D812279

If you had set the workstation and worker port numbers with the SDEBGUIP and SDEBWRKP User 0 parameters, as revealed by a VIEW command:

VIEW SDEBGUIP,SDEBWRKP SDEBGUIP 8081 TN3270 DEBUG DEFAULT GUI PORT NUMBER SDEBWRKP 3226 TN3270 DEBUG DEFAULT WORKER PORT NUMBER 

The previous DEBUG ON command could be simplified:

TN3270 DEBUG ON DEBCLIENT 198.242.244.235 

In this case, you receive different confirmation messages:

***  MSIR.0942: TN3270 Debugger GUI port defaulted to 8081 ***  MSIR.0942: TN3270 Debugger Worker port defaulted to 3226 ***  MSIR.0915: Debugging is on: client is 198.242.244.235 port 8081,        sessionID: sessionID: 00000069D812279 

You can also use asterisks to indicate that the port defaults are to be taken. These two commands are equivalent:

TN3270 DEBUG ON DEBCLIENT 198.242.244.235 * *  TN3270 DEBUG ON DEBCLIENT 198.242.244.235 

You receive an error message if you use either of the above commands without having set the default port values. To take the GUI port default but specify a value for the worker port, you must use an asterisk in the GUI port position:

TN3270 DEBUG ON DEBCLIENT 198.242.244.235 * 3226 

  You can further simplify the connection command by taking advantage of the janClientPort and pcHost parameter defaults. If the DEBCLIENT port is defined with the MASTER parameter, and SDEBGUIP and SDEBWRKP are as above, these commands are equivalent:

TN3270 DEBUG ON * .  TN3270 DEBUG ON 

On the Debugger Client, Connection from Online displays in the Status bar after the DEBUG ON command is issued. This indicates that the Debugger is "on" and awaiting the next program to debug.

After the command runs successfully, any User Language program you initiate from the Model 204 command line will appear in the Source Code tab of the Debugger Client GUI for debugging.

TN3270 DEBUG OFF

TN3270 DEBUG OFF stops a debugging session. The command is issued as is from the Model 204 command prompt (or from your BATCH2 stream or a procedure); it has no additional parameters.

After issuing the command, you should receive this response in Model 204:

***  MSIR.0913: TN3270 Debugger is now off 

On the Debugger Client, Online has disconnected displays in the Status bar.

You can also turn off the TN3270 Debugger by logging off of Model 204 (any logoff is an implied TN3270 DEBUG OFF).

The turnOffDebugging mappable command for a Client button, hot key, or macro is equivalent to  TN3270 DEBUG OFF. This alternative lets you turn off the Debugger at any time during the debugging of a program, and it provides even more flexibility than using a procedure to issue TN3270 DEBUG OFF.

TN3270 DEBUG SUSPEND

TN3270 DEBUG SUSPEND immediately discontinues the debugging of the current request, but preserves the connection from the Online thread to the Debugger Client (that is, debugging is inactive but in a state where it can be readily reactivated). Debugging can continue if a TN3270 DEBUG RESUME command is issued from the command line or in an included procedure.

Issuing TN3270 DEBUG SUSPEND has no effect and receives a harmless error message in either of these cases:

  • Debugging is not currently active for this thread (via TN3270 DEBUG ON or TN3270 DEBUG RESUME).
  • Debugging is already suspended (via TN3270 DEBUG SUSPEND).

Once you suspend debugging, the current program (if any) executes immediately, and the Debugger continues in the suspended state until you issue a TN3270 DEBUG RESUME or a TN3270 DEBUG OFF command. While debugging is suspended, you can execute Model 204 commands from the command line as usual; the difference between debugging being suspended and being off is that the Client remains in a "waiting" state.

TN3270 DEBUG CLIENTCOMMAND

TN3270 DEBUG CLIENTCOMMAND lets you specify a command or macro to be invoked by the Client. The single parameter of TN3270 DEBUG CLIENTCOMMAND is the command or macro you want to send, specified without regard for case:

TN3270 DEBUG CLIENTCOMMAND command

If command is preceded by a keyword or followed by parameter(s), such a "clause" must be quoted. See the examples below.

If command is not qualified by the keyword command or macro, the Debugger Client searches first for a macro named command, then for a Client command named command. You can use the command or macro keyword to search exclusively for a specified command or exclusively for a specific macro. The macro search is restricted to the Client installation folder or the designated macro folder.  

Three examples follow:

TN3270 DEBUG CLIENTCOMMAND clearWatch     TN3270 DEBUG CLIENTCOMMAND 'addwatch %watchthis'     TN3270 DEBUG CLIENTCOMMAND 'macro mymacro %s'  

If the TN3270 Debugger is not currently in a session, issuing TN3270 DEBUG CLIENTCOMMAND has no effect and receives a harmless message.

You can also execute Client commands and macros from the clientCommand and command methods of the DebuggerTools class.

TN3270 DEBUG RESUME

TN3270 DEBUG RESUME lets you resume debugging that was previously suspended with TN3270  DEBUG SUSPEND. When you issue TN3270 DEBUG RESUME (from the command line or in a procedure) while debugging is suspended, the Debugger immediately returns to normal debugging mode.

Issuing TN3270 DEBUG RESUME has no effect and receives a harmless error message in either of these cases:

  • Debugging is already active for this thread (via TN3270 DEBUG ON or TN3270 DEBUG RESUME).
  • Debugging is currently off (via TN3270 DEBUG OFF or because it has yet to be initiated for this thread via TN3270 DEBUG ON).

You can use TN3270 DEBUG OFF (or the turnOffDebugging mappable Client command) to turn off debugging for a thread for which debugging is resumed.

After a successful TN3270 DEBUG RESUME, the Client restores any White List or Run Until processing that was active prior to the TN3270 DEBUG SUSPEND.

TN3270 DEBUG STATUS

TN3270 DEBUG STATUS provides a simple status report about the worker threads for TN3270 Debugger sessions, Janus Debugger sessions, or both for a given <vavr>Model 204 Online.

The command is issued as is from the Model 204 command prompt (or at the end of your BATCH2 stream); it has no arguments. After issuing the command, you receive a display like the following:

***  Janus/TN3270 Debugger status: Total workers=12  ***  Janus/TN3270 Debugger status: Janus Debugger Sessions=3  ***  Janus/TN3270 Debugger status: TN3270 Debugger Sessions=1  ***  Janus/TN3270 Debugger status: Total Active Sessions=4  ***  Janus/TN3270 Debugger status: Draining=0  ***  Janus/TN3270 Debugger status: Available=8  ***  Janus/TN3270 Debugger status: Janus Debugger Session HWM=5 ***  Janus/TN3270 Debugger status: TN3270 Debugger Session HWM=1

where:

Total workers The number of workers created with the DEBUGMAX User 0 parameter
Janus Debugger Sessions Worker threads currently being used for Janus Debugger sessions, if any
TN3270 Debugger Sessions Worker threads currently being used for TN3270 Debugger sessions
Total Active Sessions Janus Debugger Sessions + TN3270 Debugger Sessions
Draining Workers that are transitioning from Active to Available
Available Total workers: (Total Active Sessions + Draining)
Session HWM The greatest value that the number of concurrent users has reached, per Debugger product (Janus Debugger and TN3270 Debugger) since the Online was started.