IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

step by step trace 4 ISPF dialog called assembler program


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Tue Dec 13, 2022 7:44 am
Reply with quote

Is there any way to use step by step trace (IBM debugging tool) for assembler program called by a rexx exec in an ISPF dialog?

I use this all the time to debug assembler programs executed in JCL, but.. has anyone done this to debug an assembler program called in an ISPF dialog?

if not, is the only way to debug an assembler program called in a dialog is by looking at dumps when it bombs?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2385
Location: Silicon Valley

PostPosted: Wed Dec 14, 2022 1:34 am
Reply with quote

Several years ago, I used Rational Developer for Z to debug, but if I recall correctly, they are somewhat similar to Debug Tool.

But there are a couple of methods... I provided the TCPIP address of the debugger when I compiled the program. And then the program 'phoned home' when it was executed. The program does not know that it executes in TSO vs. batch... it still executes the same.

Can you describe how your batch debug is setup?
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Wed Dec 14, 2022 5:46 am
Reply with quote

here is the code I use for batch debug
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 745
Location: Whitby, ON, Canada

PostPosted: Wed Dec 14, 2022 7:24 am
Reply with quote

You have to add the debug datasets to the ISPF procedure (REXX or CLIST). If unfamiliar with this, read up on the TSO command ALLOC.

Or you can allocate them separately to your TSO session before starting up the ISPF function that runs your program.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Wed Dec 14, 2022 7:55 am
Reply with quote

then SELECT EQANMDBG instead of your normal program, right?

ok. I saw something like that described in the debug manual, for programs like cobol, pl1 - but very little about assem.

the ISPF SELECT of a program has a PARM parameter, but I'm using it to pass a DSN Name already. so.. better to allocate all this first.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Sat Dec 17, 2022 3:41 am
Reply with quote

I coded something up, but probably missed something. but, as I'm starting the Christmas holidays, I will pick this back up in 2023. and post when I get it working.

Thanks for your help.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Wed Jan 11, 2023 5:20 am
Reply with quote

I finally got back to this. I set up the debug allocations like I do in JCL (with DDs) - and I trace the rexx exec and see all the allocations are done - no errors, but when it gets to debug - it keeps telling me it can't find the program.

I've checked the name , the loadlib - everything is there. When I run the exec without the debug setup, it has no problem finding my program bcz it abends a ways in the program, so it is executing some instructions in my asm program.

Why can't Debug find YBALRD3 when Rexx without debug can?

so, here is my linkdeck:

Code:
*-----------------------------------------------------------                   
* PROGRAM YBALRD3 FOR LARS CLOG DISPLAY  (PRODUCTION LARS)                     
*   MODIFIED FROM LBALRDF                                                       
*-----------------------------------------------------------                   
 ORDER   LBALRD3A                                                               
 ENTRY   LBALRD3A                                                               
 INCLUDE OBJLIB(YBALRD3A)                                                       
 INCLUDE OBJLIB(LBALRD3B)                                                       
 INCLUDE OBJLIB(LBALRD3C)                                                       
 INCLUDE OBJLIB(LARSLOOK)                                                       
  NAME YBALRD3(R)


here is the REXX code WITHOUT the debug setup - the one that selects my ASM program YBALRD3 and starts it (so it finds it)
Code:
/*                                                                             
----------------------------------------------------------------------         
  $LarsBAL : bring up Lars Balancing                                           
----------------------------------------------------------------------         
*/                                                                             
$LarsBal:                                                                       
  trace ?r                                                                     
  ver = 'ZOSV2R5'                                                               
  address TSO "ALTLIB ACTIVATE APPLICATION(CLIST) " ,                           
              "DATASET('SYS3.LARS."ver".CMDP')"                                 
                                                                               
  address ISPEXEC                                                               
         "LIBDEF ISPPLIB DATASET ID('SYS3.LARS."ver".PNLS') STACK"             
         "LIBDEF ISPSLIB DATASET ID('SYS3.LARS."ver".SKEL') STACK"             
         "LIBDEF ISPMLIB DATASET ID('SYS3.LARS."ver".MSGS') STACK"             
  /*                      */                                                   
  say 'CLOG='t$clog                                                             
         "SELECT PGM(YBALRD3) PARM("t$clog")"                                   
  /*                      */                                                   
  address TSO "ALTLIB DEACTIVATE APPLICATION(CLIST)"                           
  address ISPEXEC                                                               
         "LIBDEF ISPPLIB"                                                       
         "LIBDEF ISPSLIB"                                                       
         "LIBDEF ISPMLIB"                                                       
return;                                             


and here is the REXX with the DEBUG setup before executing my asm program... only it can't seem to find my program.

Code:
/*                                                                             
----------------------------------------------------------------------         
  $LarsBAL : bring up Lars Balancing                                           
----------------------------------------------------------------------         
*/                                                                             
$LarsBal:                                                                       
  trace ?r                                                                     
  ver = 'ZOSV2R5'                                                               
  address TSO "ALTLIB ACTIVATE APPLICATION(CLIST) " ,                           
              "DATASET('SYS3.LARS."ver".CMDP')"                                 
                                                                               
  address ISPEXEC                                                               
         "LIBDEF ISPPLIB DATASET ID('SYS3.LARS."ver".PNLS') STACK"             
         "LIBDEF ISPSLIB DATASET ID('SYS3.LARS."ver".SKEL') STACK"             
         "LIBDEF ISPMLIB DATASET ID('SYS3.LARS."ver".MSGS') STACK"             
         "LIBDEF ISPLLIB DATASET ID('CGD89.ISPF.LOADLIB') STACK"               
  /*                      */                                                   
  say 'CLOG='t$clog                                                             
 /*                                                                             
   -----------------------------------------------------------------           
     START DEBUG  - WILL KICK OFF YOUR PROGRAM IN STEP BY STEP TRACE           
   -----------------------------------------------------------------           
 */                                                                             
                                                                               
  ADDRESS TSO "ALLOCATE FI(EQADEBUG) DA('PDEND.USN.COM.IDILANGX') SHR"         
  ADDRESS TSO "ALLOCATE FI(IDILANGX) DA('PDEND.USN.COM.IDILANGX') SHR"         
  ADDRESS TSO "ALLOCATE FI(EQANMDBG) DA('CGD89.ISPF.EXEC($DBGIN1)') SHR"       
  ADDRESS TSO "ALLOCATE FI(DTCMD)    DA('CGD89.ISPF.EXEC($DBGIN2)') SHR"       
  ADDRESS TSO "ALLOCATE FI(IDIHIST)  DA('CGD89.FAULT.HISTORY') SHR"             
         "SELECT PGM(EQANMDBG) PARM("t$clog")"                                 
  /*                                                                           
         "SELECT PGM(YBALRD3) PARM("t$clog")"                                   
  */                                                                           
 /*                                                                             
   -----------------------------------------------------------------           
  ADDRESS TSO "ALLOCATE FI(CEEDUMP)  SYSOUT"                                   
     end DEBUG  - WILL KICK OFF YOUR PROGRAM IN STEP BY STEP TRACE             
   -----------------------------------------------------------------           
 */                                                                             
  /*                      */                                                   
  address TSO "ALTLIB DEACTIVATE APPLICATION(CLIST)"                           
  address ISPEXEC                                                               
         "LIBDEF ISPPLIB"                                                       
         "LIBDEF ISPSLIB"                                                       
         "LIBDEF ISPMLIB"                                                       
return;                                                                         
                                                     


DBGIN1:
Code:
YBALRD3,TEST(,DTCMD,,VTAM%CGD89:*)


DBGIN2:
Code:
  SET DISASSEM ON;                                                             
  STEP;                                                                         
  SET DISASSEM OFF;                                                             
  AT ENTRY YBALRD3;                                                             
  SET DEFAULT LISTING 'PDEND.USN.COM.IDILANGX';                                 
  LDD YBALRD3::YBALRD3A                                                         
  LDD YBALRD3::LBALRD3B                                                         
  LDD YBALRD3::LBALRD3C                                                         
  LDD YBALRD3::LARSLOOK                                                         
  SET ASSEM ON;                                                                 
  SET AUTO ON BOTH;                                                             
  STEP;                         
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2385
Location: Silicon Valley

PostPosted: Wed Jan 11, 2023 12:32 pm
Reply with quote

In your first example, you do not have LIBDEF ISPLLIB... please explain where your loadlib data set is allocated.

In the second example, you do have LIBDEF ISPLLIB, but that is used only for ISPF initiated calls. PGM(EQANMDBG) will not call your program through ISPF.

I think what you need is to use the TSOLIB command prior to starting ISPF to add your loadlib to the MVS search order. Another alternative is to concatenate your loadlib to the ISPLLIB allocation prior to starting ISPF.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Wed Jan 11, 2023 7:46 pm
Reply with quote

This function is part of an ISPF application XXXX that I wrote - which does several functions for a group of application programmers working on a specific project.

in the first example, the one that works, the exec that brings up the application XXXX has this to assign my loadlib to ISPLLIB:



Code:
/*
----------------------------------------------------------------------
   Add XXXX Load libraries to ISPF Load libraries
----------------------------------------------------------------------
*/
LLIB1 = "'CGD89.ISPF.LOADLIB'"
LLIB2 = "'PDEND.USN.LOADLIB'"
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID("LLIB2") STACK";
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID("LLIB1") STKADD";

/*


in the example with the DEBUG code, the first time I tried it, I did not have this statement:

Code:
         "LIBDEF ISPLLIB DATASET ID('CGD89.ISPF.LOADLIB') STACK"


I added that AFTER I kept getting the message that DEBUG could not find my program YBALRD3. I thought I would make sure it was there just before the SELECT - but it didn't make a difference.

So, now I'm wondering if I am not calling the program correctly, which is why I included the linkedit. but.. I don't see anything wrong there.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Wed Jan 11, 2023 11:51 pm
Reply with quote

Pedro wrote:
In your first example, you do not have LIBDEF ISPLLIB... please explain where your loadlib data set is allocated.

In the second example, you do have LIBDEF ISPLLIB, but that is used only for ISPF initiated calls. PGM(EQANMDBG) will not call your program through ISPF.

I think what you need is to use the TSOLIB command prior to starting ISPF to add your loadlib to the MVS search order. Another alternative is to concatenate your loadlib to the ISPLLIB allocation prior to starting ISPF.


I think that even though I add my loadlib to the call to this particular ISPF application XXXX, when I call the "sub application" - it doesn't seem to find it unless it is on the logon load libraries only. so.. I will look into the TSOLIB and/or adding it to my logon proc before I got to ISPF.

I will let you know if that fixes it.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2385
Location: Silicon Valley

PostPosted: Thu Jan 12, 2023 1:57 am
Reply with quote

re: "or adding it to my logon proc before I got to ISPF"

Most users do not have authority to update the logon proc. My suggestion was to append your private data set to whatever is already there. *

Do something like this before starting ISPF:
Code:
/* rexx */
"ALLOC F(MYLLIB) DA('HLQ.SLQ.LOAD') SHR REU"
CALL BPXWDYN "CONCAT DDLIST(ISPLLIB,MYLLIB) MSG(2)"


Read about BPXWDYN in "Using REXX and z/OS UNIX System Services", SA23-2283. (even though it is described in the USS manuals, it will work outside of Unix services.)

* This assumes that there is something already allocated to ISPLLIB. If there is not, then use a simple ALLOCATE command before starting ISPF.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Thu Jan 12, 2023 7:38 am
Reply with quote

Thank you. I always learn something new from you. I knew what you meant - I know systems does not want you messing around with logon procs they set up for everyone else. and with good reason. I'm fine with that.

but I have a rexx exec that I execute after I log into tso and before I call ISPF. That's what I meant by "my logon proc". icon_smile.gif

I spent today going thru what I did with a fine tooth comb, and found a bug in a new procedure I was using. I ended up creating my own libraries for everything, making sure what I thought I was creating was there. And ended up cleaning up a rexx exec I call right after logging in to TSO in addition to adding my loadlib to ISPLLIB at logon time.

and, I actually got to STEP by STEP trace from the REXX Exec. .after I added the loadlib to my logon rexx and I fixed the other 2 problems I found with another group's procedures.

but now it is telling me that the DEBUG has no LANGX code - even though I set up my own assembler jcl to created ADATA and run the debug program to create the LANGX that debugger uses. I decided to call it a day.

I will go thru the debug manual and figure out what I set up wrong. but.. I was just glad to finally get step by step trace up from REXX.

So, thanks for your help. When I get everything working, I will post it, as I could not find much on setting this up in rexx.

thanks again.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Fri Jan 13, 2023 3:19 am
Reply with quote

Pedro, if you look at the linkdeck for YBALRD3, you will see an INCLUDE for a system load module libary - which includes ISPLINK and ISPEXEC. in this ASM program, instead of dynamically calling ISPLINK and ISPEXEC, it does a call to these programs -like this:

IBM man desc

which is why I had to do the extra include when assembling these programs.

I don't know why the original programmers did it this way, (instead of using LINK EP=) but.. it is that way throughout this package. So that's why i just created the linkdeck like they did for the original package.

but I think this one include is why I can't go any further with DEBUG. it keeps saying it can't display the instructions because the compile for debug is wrong.

When I looked in the debug manuals for some instruction on how to do this, they talk about LLA and using EQALOAD to allocate this library (but no examples or syntax that I could find).

so I added allocating the System Load Library PDS with a TSO allocate statement. brought up debug.. but same problem.

I keep getting this:

Code:
Disassem LOCATION: ISPLINK :> A( 00237E28 )
Command ===>
MONITOR -+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+---10---
********************************************************* TOP OF MONITOR ***********************************
                                  ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----
0001    ***** AUTOMONITOR YBALRD3 ::> ISPLINK :> X'00000000' *****
0002    R15                     X'00237E28'
0003    _STORAGE(X'00237E6C'::0)
0004         ***** Previous Statement YBALRD3 ::> YBALRD3A :> X'00000000' *****
0005    The previous statement is out of scope.  No variables can be displayed.
******************************************************** BOTTOM OF MONITOR *********************************
SOURCE: ISPLINK --1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+---1
********************************************************** TOP OF SOURCE ***********************************
******************************************************** BOTTOM OF SOURCE **********************************




do you know what I should be doing to debug a program where one of the includes is to a system load library with members like ISPLINK
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2385
Location: Silicon Valley

PostPosted: Fri Jan 13, 2023 7:29 am
Reply with quote

I have never used Debugtool, but I took a peek at the manuals.

Please try this in your DBGIN2 file.
Code:
SET ASSEMBLER STEPOVER EXTONLY

which tells the debugger to skip over external subroutines.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Sat Jan 14, 2023 1:43 am
Reply with quote

I will try that, but I think that is the default. The top command is usually the default.
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Sat Jan 14, 2023 2:03 am
Reply with quote

found my stupid error. after doing some more reading, I realized I could read the LOG in debug, and did that (zoomlog). and it told me 2 LDD statements were wrong. so, I looked and looked, and realized I hadn't put the ending ';' on each LDD statment. What confused me what the error message saying that the compile options were wrong.. so, I kept looking there.

fixed that and tried again. I then got errors saying that it couldn't find my programs on my userid.EQALANGX pds. so, it must be defaulting that somewhere - bcz I did specifify where the language files should go. Will find out about that later. Might look up a lot of debug info later. a LOT of options in Debug.

but.. it did start stepping thru my program. so.. that is great, because i can finally figure out the problem in this program.

So, thanks again, Pedro for helping me.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2385
Location: Silicon Valley

PostPosted: Sat Jan 14, 2023 3:52 am
Reply with quote

You are welcome!
Back to top
View user's profile Send private message
Lynne

New User


Joined: 15 Jan 2015
Posts: 84
Location: USA

PostPosted: Mon Jan 30, 2023 4:59 am
Reply with quote

Solution: What worked for me that enabled me to use IBM Step by Step Trace to trace an Assembler program called by an ISPF dialog application REXX exec:

The original call to the assembler program is this instruction:
"SELECT PGM(YBALRD3) PARM("t$clog")"

I comment that out in the following code and add these statements which will call IBM Debug (EQANMDBG), and tell it to execute my program in step by step mode:

Code:
                               
                                                                               
 address ISPEXEC                                                               
         "LIBDEF ISPPLIB DATASET ID('SYS3.LARS."ver".PNLS') STACK"             
         "LIBDEF ISPSLIB DATASET ID('SYS3.LARS."ver".SKEL') STACK"             
         "LIBDEF ISPMLIB DATASET ID('SYS3.LARS."ver".MSGS') STACK"             
/*                                                                             
   -----------------------------------------------------------------           
     START DEBUG  - WILL KICK OFF YOUR PROGRAM IN STEP BY STEP TRACE           
   -----------------------------------------------------------------           
 */                                                                             
                                                                               
  ADDRESS TSO                                                                   
          "ALLOCATE FI(EQALOAD)  DA('ISP.SISPLOAD') SHR"                       
          "ALLOCATE FI(EQADEBUG) DA('CGD89.ISPF.IDILANGX') SHR"                 
          "ALLOCATE FI(IDILANGX) DA('CGD89.ISPF.IDILANGX') SHR"                 
          "ALLOCATE FI(EQANMDBG) DA('CGD89.ISPF.EXEC($DBGIN1)') SHR"           
          "ALLOCATE FI(DTCMD)    DA('CGD89.ISPF.EXEC($DBGIN2)') SHR"           
          "ALLOCATE FI(IDIHIST)  DA('CGD89.FAULT.HISTORY') SHR"                 
  trace off                                                                     
                                                                               
   address ISPEXEC "SELECT PGM(EQANMDBG) PARM("t$clog")"                       
  /*                                                                           
         "SELECT PGM(YBALRD3) PARM("t$clog")"                                   
  */                                                                           
 /*                                                                             
   -----------------------------------------------------------------           
     end DEBUG  - WILL KICK OFF YOUR PROGRAM IN STEP BY STEP TRACE             
   -----------------------------------------------------------------           
 */                                                                             
                                                                               
  ADDRESS TSO                                                                   
          "FREE FI(EQALOAD)"                                                   
          "FREE FI(EQADEBUG)"                                                   
          "FREE FI(IDILANGX)"                                                   
          "FREE FI(EQANMDBG)"                                                   
          "FREE FI(DTCMD)"                                                     
          "FREE FI(IDIHIST)"                                                   
                                                     
return;


the user input to IBM Debug is in these files:

$DBGIN1:
Code:
YBALRD3,TEST(,DTCMD,,VTAM%CGD89:*)     


$DBGIN2:
Code:
  SET DISASSEM ON;                                                             
  STEP;                                                                         
  SET DISASSEM OFF;                                                             
  SET DEFAULT SCROLL CSR;                                                       
  AT ENTRY YBALRD3;                                                             
  SET DEFAULT LISTING 'CGD89.ISPF.IDILANGX';                                   
  SET ASSEMBLER STEPOVER EXTONLY;                                               
  LDD YBALRD3::YBALRD3A;                                                       
  LDD YBALRD3::YBALRD3B;                                                       
  LDD YBALRD3::YBALRD3C;                                                       
  LDD YBALRD3::LARSLOOK;                                                       
  SET ASSEMBLER ON;                                                             
  SET AUTOMONITOR ON BOTH;                                                     
  STEP;


LinkDeck of the ASM program (to understand the above:
Code:
*-----------------------------------------------------------                   
* PROGRAM YBALRD3 FOR LARS CLOG DISPLAY  (PRODUCTION LARS)                     
*   MODIFIED FROM LBALRDF                                                       
*-----------------------------------------------------------                   
 ORDER   YBALRD3A                                                               
 ENTRY   YBALRD3A                                                               
 INCLUDE OBJLIB(YBALRD3A)                                                       
 INCLUDE OBJLIB(YBALRD3B)                                                       
 INCLUDE OBJLIB(YBALRD3C)                                                       
 INCLUDE OBJLIB(LARSLOOK)                                                       
  NAME YBALRD3(R)


Refer to the IBM Debug manuals to know what the files are needed for IBMDebug, and you will have to find out the actual file names for your installation.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Forcing a step to run (even if abended) JCL & VSAM 7
No new posts Batch call online program, EXCI task ... CICS 3
No new posts Capturing COBOL job and program names... All Other Mainframe Topics 2
No new posts Receiving RC 5 when executing REXX pr... CLIST & REXX 3
No new posts Evaluate variable to execute a jcl step JCL & VSAM 3
Search our Forums:

Back to Top