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

Capturing TSO ISRDDN E output.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jun 13, 2011 12:56 pm
Reply with quote

Hi,

I am trying to capture "TSO ISRDDN E" output into a variable, using REXX program(interactive mode).
Tried the below program, but it invokes the ISRDDN E ISPF panel in interactive mode and does not store the data in DATAS1.x variables.
Code:
/*REXX*/
DSN='PS.FILE.NAME'           
   I = OUTTRAP(DATAS1.)           
ADDRESS 'TSO' "ISRDDN E" "'"DSN"'"
   I = OUTTRAP(OFF)               
SAY 'DATAS1.0 IS ' DATAS1.0       
SAY 'DATAS1.1 IS ' DATAS1.1       
SAY 'DATAS1.2 IS ' DATAS1.2       
SAY 'DATAS1.3 IS ' DATAS1.3       
SAY 'DATAS1.4 IS ' DATAS1.4       
SAY 'DATAS1.5 IS ' DATAS1.5       
SAY 'DATAS1.6 IS ' DATAS1.6       
EXIT

Could you please let me know how this could be achieved.
Thanks for viewing.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Jun 13, 2011 1:28 pm
Reply with quote

Can't recall exactly, but I think that there is an option to write the output to a dataset, I think it may be SAVE.

Have a quick google, and you may then be able to read in the newly created file.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 13, 2011 1:35 pm
Reply with quote

what You ask for cannot be done... ( thru isrddn )
isrddn output goes to a panel that' s it

if You need to pick up in rexx the enq You can
use the Adress console stuff to issue a
D GRS,RES=(*,<dataset name>/<dataset mask>)
ad process the returned data
see here for examples ( very old but still usable )
www.redbooks.ibm.com/abstracts/sg244626.html?Open

or look at
www.sillysot.com/mvs/index.htm?queryenq.htm

or look at the cbttape for more tools ( file 409/410) MXi by Rob scott
iirc it has a rexx interface

just found in my snippets library


Code:
****** ***************************** Top of Data ******************************
000001 /*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000002 /*                                                                   */
000003 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000004 Trace "O"
000005 Parse Source _sys _how _cmd .
000006 args = "d grs,res=(*,enrico.*)"
000007 cart     = "OPER0001"
000008 _msg = msg("OFF")
000009 zrc = $tsoex("CONSOLE DEACTIVATE ")
000010 zrc = $tsoex("CONSPROF SOLDISP(NO) SOLNUM(9999)" )
000011 zrc = $tsoex("CONSOLE ACTIVATE")
000012 if zrc = 0 then do
000013    zrc = $tsoex("CONSOLE SYSCMD("args") CART("cart") ")
000014    if zrc = 0 then do
000015       zrc = getmsg("console.",,cart,,120)
000016    end
000017    zrc = $tsoex("CONSOLE DEACTIVATE ")
000018 end
000019 do i = 1 to console.0
000020    say i console.i
000021 end
000022 _msg = msg(_msg)
000023 exit
000024
000025 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000026 $tsoex:
000027    tso_0tr = trace("O")
000028    Address TSO arg(1)
000029    tso_0rc = rc
000030    trace value(tso_0tr)
000031    return tso_0rc
000032
000033 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000034 $ispex:
000035    isp_tr = trace("O")
000036    Address ISPEXEC arg(1)
000037    isp_rc = rc
000038    trace value(isp_tr)
000039    return isp_rc
000040 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
000041 $isred:
000042    isr_tr = trace("O")
000043    Address ISREDIT arg(1)
000044    isr_rc = rc
000045    trace value(isr_tr)
000046    return isr_rc
000047
****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jun 13, 2011 1:47 pm
Reply with quote

After reading an article on ISRDDN (found via Google) it seems that PF1 is a good place to look. But. my thought is, you do not want to see the ISRDDN output at all? OUTTRAP traps messages - not panels and ISRDDN writes it output to panels.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jun 13, 2011 3:40 pm
Reply with quote

Hello All, Thanks for your time & suggestions.
@Expat SAVE command worked for saving dataset list from ISPF 3.4 option, but did not work on ISRDDN panel. So I assume that SAVE might not work when issued via
REXX.

@Enrico Many thanks for your snippet code, Unfortunately I do not have access to CONSOLE . but I have access to issue console commands via SDSF(interactive mode), The command you suggested,
"D GRS,RES=(*,<dataset name>/<dataset mask>)" works well when issued via SDSF(interactive mode).
But I have a problem in which I am unable to issue console commands via batch. www.ibmmainframes.com/viewtopic.php?t=54392&postdays=0&postorder=asc&start=0

Regarding QueryEnq function, I am not sure if the Assembler is installed in our shop, but still ran a test REXX job,
Code:
/* Rexx - QueryEnq example */
Say center(' TESTING ')
s = queryenq("'some.dataset.opened.in.edit.mode'")
Do a = 1 to enqjob.0
  Say enqjob.a  enqtype.a
End
Exit

The above REXX was running in an infinite loop printing the first SAY command only, over and over.
TESTING
TESTING
TESTING
TESTING
.
.
.
I think I will settle with "D GRS,RES=(*,<dataset name>/<dataset mask>)" for now, untill access issues are sorted out.
Quote:
you do not want to see the ISRDDN output at all?
nope, the panel is not required, but the data is needed.
Quote:
OUTTRAP traps messages - not panels and ISRDDN writes it output to panels.
Good to know. Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 13, 2011 3:53 pm
Reply with quote

Quote:
Regarding QueryEnq function, I am not sure if the Assembler is installed in our shop, but still ran a test REXX job,


assembler is certainly installed in Your shop...

... about authorization
if You have the need to, somebody should take care of them
or You should be asked to satisfy the requiremens
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jun 13, 2011 4:57 pm
Reply with quote

Hello,
Quote:
assembler is certainly installed in Your shop...

By 'the assembler' i meant the assembler code found on sillysot website.

Anyway thanks Enrico for the hint with QUERYENQ icon_biggrin.gif Upon searching I got the below code by Robert Zenuk & works well..
Code:
/*REXX*/
ARG  MAJOR MINOR ASNAME                               
IF MAJOR = '' THEN MAJOR  = '*'                       
IF MINOR = '' THEN  MINOR  = '*'                       
IF ASNAME = '' THEN ASNAME = USERID()                 
ADDRESS  ISPEXEC                                       
"QUERYENQ TABLE(QUERYENQ) QNAME(MAJOR)  RNAME(MINOR)",
"REQ("ASNAME") SAVE(ENQ)"                             
IF RC <> 0 THEN SAY  'QUERYENQ RC='RC                 
"TBEND QUERYENQ"                                       
"BROWSE  DATASET('"USERID()".ENQ.ENQLIST')"           
EXIT   


Invocation by
Code:
TSO QUERYENQ * dataset.under.concern *


Regards,
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Capturing Job Execution Information All Other Mainframe Topics 3
No new posts Rexx log capturing CLIST & REXX 15
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts Build a record in output file and rep... DFSORT/ICETOOL 11
Search our Forums:

Back to Top