Default language.

Interactive Debug (DBUG)


The TSO Client is an ISPF Application that consists of CLIST, REXX, and Program code. Interactive Debug provides the mechanism to interactively trace and debug the CLIST or REXX code.

Invoking DBUG

Typing DBUG on the Command line from within Code Pipeline displays the screen shown in the following figure.

Invoking DBUG

ISPW -------------------------  DEBUG FACILITY  ------------------------- ISPW
COMMAND  ===>                                                                 
                                                                              
   Current DEBUG value ...                                                    
                                                                              
   Value to be set?    ==>                 REXX Trace setting  ==> ?R         
                                                                              
   Propagate?          ==> N (Y/N)                                            
                                                                              
                                                                              
   ENTER to change value(s) or  END to retain current value(s)                              

Fields on the Debug Facility screen are described in the following table.

Field Descriptions

Field

Description

Current DEBUG value

If a debug value has been previously set, this would appear here. When blank, it indicates that Debug is turned off.

Value to be set?

This determines the level of Debug. All ISPF routines in Code Pipeline have unique Debug values. When the Debug value set on this screen matches the internal routine value, Debug is turned on for that routine.

REXX Trace setting

This REXX Trace setting option will be used with the REXX TRACE command. For simple tracing:

  • The value “?R” (interactive trace of results) is used, and execution of the REXX program pauses after the results of every statement are displayed.
  • The value “R” will trace the results of every statement and continue to execute the program.


Propagate?

Determines whether Debug is to continue to called routines, irrespective of their internal Debug identifiers. Values can be:

  • Y – Keep Debug on for called routines.
  • N – Pass only the Debug value to the called routine, and only keep Debug on if the internal Debug value matches the current Debug setting.

Value to be set?

In most Code Pipeline routines, the Debug Value is derived from the last part of the member name. For instance, in the standard delete exit REXX routine named WZZPSD#, its Debug Value is PSD#. However, there are a few cases that deviate from this pattern. To identify the appropriate Debug Value for a REXX or CLIST routine, examine the routine and look at the if statement that checks the value of the WZ@DBO variable.

Special Value “W”

If “W” is specified in the Value to be set? field, Debug will be turned on for all Code Pipeline routines.

Writing Your Own Routines

When writing custom exits, it is useful to start the routine with the Debug handling code that is used in the Code Pipeline routines. The few lines of code shown in the following figure are from the Code Pipeline routine WZZPSD#.

Writing Routines

/* REXX    TRACE ?R    */                                               
  ADDRESS ISPEXEC                                                       
  PARSE UPPER ARG WZ@DBP Z             /* <1ST WORD> ... */             
  IF WZ@DBP = "DEBUG" ,                                                 
  THEN DO                                                               
    STRC = "Y"                                                          
    "ISPEXEC VGET (WZ@DBR ZSCREEN ZUSER Z)"                             
  END                                                                   
  ELSE DO                                                               
    "ISPEXEC VGET (WZ@DBO WZ@DBP WZ@DBR ZSCREEN ZUSER Z)"               
    IF WZ@DBO = "PSD#" ,                                                
     | WZ@DBO = "W" ,                                                   
    THEN STRC = "Y"                                                     
    ELSE WZ@DBP = ""                                                    
  END                                                                   
  DEBUG = WZ@DBP                                                        
  IF STRC = "Y"  &  WZ@DBR = ""   THEN WZ@DBR = "?R"       /* ? TEMP */  

Change the highlighted Debug value to something that makes sense for your routine, and it will then be able to be traced in the same way that the Code Pipeline routines are traced.

Calling Other Routines

If you insert a call to another ISPF routine, make sure that the keyword DEBUG is passed as shown in the code snippet below:

"ISPEXEC SELECT CMD(%WZZHFS# "DEBUG" POPT("POPT") "

This will ensure that any Debug values that are set will be passed to the called routine.

Invoking Code Pipeline with DEBUG

The initial REXX Exec WZU@PRIM is user-customizable and may need to be traced to troubleshoot a problem. If the Panel with the Code Pipeline Option has been updated as described in the Code Pipeline Installation and Configuration Guide, tracing can be turned on by appending the option with “.DEBUG”. For example, if Code Pipeline is option W, invoke Code Pipeline with the DEBUG option by typing:

W.DEBUG

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI DevX Code Pipeline 22.01