Tuesday, December 20, 2011

Xpeditor: How to debug programs interactively under batch

With the Batch Connect facility, you can submit your execution JCL in batch and connect directly to the job as it executes in its native environment, the MVS batch initiator.

Notes:
1.In Batch Connect mode, you do not have to allocate the files and databases required for your program to run. They are automatically allocated to the batch address space via the DD statements in the JCL.
2.No change in the TSO logon size is required for large programs.

The Batch Connect facility presents several screens that are used to automate the process of starting the session. The following summarizes the process:
1.Access the facility: Type option 3 (BATCH) on the Xpediter/TSO Primary Menu and press Enter to access the Batch menu (Figure 4-13). Type option 1 (Batch) on the Batch menu and press Enter to access the Batch Connect facility. The Process Execute JCL screen (Figure 4-14 on page 4-22) is displayed.
2. Process the execution JCL: The Process Execute JCL screen is used to identify the execution JCL for the debugging session. You can also access the ISPF editor to view and make changes to the JCL.
The JCL statements are scanned, expanded if the JCL is a procedure, and the job steps are extracted. A list of the job steps is then displayed on the Select Job Step screen.
3.Convert and submit the JCL: The Select Job Step screen is used to specify how you want each job step to execute (in interactive or unattended mode). When a job step is selected for interactive debugging, the source for that step is displayed at your terminal. When a step is selected to run in unattended mode, you cannot interact with the step from your terminal. If you want to debug the step, Xpediter debugging commands must be read from a test script and the output results from the test session are written to the session log.
You can submit the job from this screen or you can edit the JCL. When you submit the job, the Batch Connect JCL scanner automatically converts each step to execute in the specified mode (interactive or unattended).

4.Connect to the job: If you submit the job with the RUN command, you are automatically connected to the job steps that were specified to execute in interactive mode. If you submit the job with the SUBMIT command, you must use the CONNECT or STATUS command to connect your terminal to the job steps selected for interactive debugging.
Connection Security Check
Connection can be made to any job, including production jobs, as long as your site security grants the authority. The Batch Connect facility is shipped with a default security exit routine that allows connection to a job if the JOBNAME, without the last character, matches the TSO ID where the STATUS panel is accessed. When a connection cannot be made, the messages CANNOT CONNECT... or SECURITY CHECK FAILED... are issued.
The site installer can customize the security exit routine to tailor the security level for certain groups or individuals. When an asterisk (*) is entered in the JOBNAME field on the Status screen, all jobs that are waiting for connection or being tested under Batch Connect are listed. System programmers are able to connect to a remote job and use the facility as a help desk feature in debugging application programs.

Demo

Select option 3


----------------------  XPEDITER/TSO 7.7 - PRIMARY MENU  ----------------------
 OPTION  ===> 3                                                                
                                                                               
          0  DEFAULTS      - Specify defaults                                  
          1  PREPARE       - Prepare programs for debugging                    
          2  TSO           - Debug programs interactively under TSO            
          3  BATCH         - Debug programs interactively under batch          
          4  STORED PROC   - Debug DB2 Stored Procedures interactively         
          5  UTILITIES     - Perform utility functions                         
                                                                                
          FA FILE-AID      - Invoke File-AID for MVS                           
                                                                               
          C  CODE COVERAGE - Code Coverage Reports and Utilities                
                                                                               
          T  TUTORIAL      - Display information about XPEDITER/TSO            
          X  EXIT          - Exit primary menu                                 
                                                                                
    Profile ===> DEFAULT  - *** NO DESCRIPTION ***                             
                                                                               
            Press ENTER to process  or  enter END command to terminate         


Select option 1


Profile: DEFAULT ---------  Xpediter/TSO 7.7 - Batch  -------------------------
 OPTION  ===> 1                                                                 
                                                                               
          1  Batch         - Debug programs interactively under batch          
                                                                                
          2  Multi-Batch   - Debug multiple jobs interactively under batch     
                                                                               


Enter the dataset which has the JCL. Make sure jobname always TSO ID + one character. Otherwise XPED may show “Security check failed” message 

-------------------- XPEDITER/TSO - PROCESS EXECUTE JCL -----------------------
 COMMAND ===>                                                                  
                                                                               
 Primary Commands:  blank (Process JCL)   Browse   Edit   SEtup   STatus       
                                                                               
 ISPF Library:                                                                 
   Project ===>                                                                
   Group   ===>           ===>           ===>           ===>                   
   Type    ===>                                                                
   Member  ===>                (Blank for member selection list)               
                                                                                
 Other Partitioned or Sequential Dataset:                                      
    Dataset Name ===> 'MY.TEST.JCLLIB(TESTJOB)'                           
   Volume Serial ===>          (If not cataloged)                              
                                                                               
                                                                               
                                                                                
                                                                               
                                                                               
                                                                                
                                                                               
                                                                               
            Press ENTER to process  or  enter END command to terminate         
                                                                               


Select the “SE” option to setup the load library and DDIO file


Profile: DEFAULT-------  XPEDITER/TSO - SELECT JOB STEP  ----- Row 1 to 1 of 1
 COMMAND ===> se                                               SCROLL ===> PAGE
                                                                               
 Line Commands:                   Primary Commands:                            
   I - Interactive testing          Edit   - Display converted selected steps  
   U - Unattended testing           END    - Exit without processing           
  Followed optionally by:           RUN    - Submit and connect                
   C - Code Coverage                SEtup  - Setup work datasets               
   T - Code Coverage, plus TDO      SUBmit - Convert selected steps and submit 
   F - System Flow (F, CF or TF)    STatus - Display status of submitted job(s)
                                                                                
 Dataset: 'TSUBAQF.TB7500.TESTING(XPED)'                                       
                                                                               
       PROGRAM     INITSCR  POSTSCR    STEPNAME  PROCNAME  PROCSTEP  EXEC PGM  
 -----------------------------------  -----------------------------------------
 ___   TESTPRGM    ________ ________   STEP010                                 
 ******************************* Bottom of data ********************************
                                                                               

When we enter “SE” option in the previous screen, we get the below screen
                                                                               

Profile: DEFAULT--------  XPEDITER/TSO - SETUP MENU  --------------------------
 OPTION  ===>                                                                   
                                                                               
           0  JOB CARD     - JOB processing parameters                         
           1  LOADLIBS     - Application load module libraries                 
           2  DDIO         - DDIO files                                        
           3  INCLUDES     - Test script libraries                             
           4  LOG          - Session log dataset disposition                    
           5  SCRIPT       - Test script dataset disposition                   
           6  DSNLOAD      - DB2 system names and DSNLOAD libraries            
                                                                               
                                                                                
                                                                               
                                                                               
                                                                                
                                                                               
                                                                               
                                                                                
           C  CODE COVERAGE- Code Coverage setup options                       
           D  DOCUMENT     - Document dataset disposition                      
           E  EXTENDED     - Extended Setup Menu                               
           A  ALL          - Display all of the above in succession (except 0) 
                                                                               
            Press ENTER to process  or  enter END command to terminate         




Give “I” against the step for interactive debugging and enter RUN command. This will submit the below job and show us the debug screen


Profile: DEFAULT-------  XPEDITER/TSO - SELECT JOB STEP  ----- Row 1 to 1 of 1
 COMMAND ===> run                                              SCROLL ===> PAGE
                                                                               
 Line Commands:                   Primary Commands:                            
   I - Interactive testing          Edit   - Display converted selected steps  
   U - Unattended testing           END    - Exit without processing           
  Followed optionally by:           RUN    - Submit and connect                
   C - Code Coverage                SEtup  - Setup work datasets               
   T - Code Coverage, plus TDO      SUBmit - Convert selected steps and submit 
   F - System Flow (F, CF or TF)    STatus - Display status of submitted job(s)
                                                                                
 Dataset: 'TSUBAQF.TB7500.TESTING(XPED)'                                       
                                                                               
       PROGRAM     INITSCR  POSTSCR    STEPNAME  PROCNAME  PROCSTEP  EXEC PGM  
 -----------------------------------  -----------------------------------------
 I__   TESTPGM     ________ ________   STEP010                                 
 ******************************* Bottom of data ********************************

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.