Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to parse results from ADDRESS TSO command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
siebertr

New User


Joined: 25 Aug 2010
Posts: 7
Location: Brazil, Sao Paulo, Hortolandia

PostPosted: Wed Aug 25, 2010 9:04 pm    Post subject: How to parse results from ADDRESS TSO command
Reply with quote

Hi, i need to create a job to get some dataset contention information. For that, i found that i can addrress TSO to use a TSO command to check what is currently allocating a dataset in the system(in this system, there is a CLIST named FINDQ datasetname - when you use it, it will display the jobs/users that are allocating the dataset).

When i use the command TSO FINDQ DATASETNAME, a message like this is displayed:

Command: TSO FINDQ VB788.ZZZ.CLIST

Result:
SHR BY VB788 SYSDSN VB788.ZZZ.CLIST
***

If i do use the REXX code:

/*REXX*/
ADDRESS TSO "FINDQ VB788.C2581485"

the same message is displayed. I'd like to know if there is any way to parse the result of this REXX command in a variable(i want to manage the results to create a command). Thanks for any help.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Wed Aug 25, 2010 9:32 pm    Post subject:
Reply with quote

Look at OUTTRAP.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Aug 25, 2010 9:39 pm    Post subject: Reply to: How to parse results from ADDRESS TSO command
Reply with quote

Never tried it, but will OUTTRAP trap output from a CLIST?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Aug 26, 2010 11:28 am    Post subject:
Reply with quote

If I had the inclination to go back and even look at a CLIST, let alone write one, I would have tested it.

However, we don't know how the original message text is being generated from the CLIST, so it may invoke a program using TPUT, so we're well and truly stuffed at that point.

Like so many threads on the forum, we can only guess or play 20 questions to get the correct information required to give a reasonable reply.
Back to top
View user's profile Send private message
siebertr

New User


Joined: 25 Aug 2010
Posts: 7
Location: Brazil, Sao Paulo, Hortolandia

PostPosted: Fri Aug 27, 2010 12:35 am    Post subject:
Reply with quote

actually i am trying to issue the console command:

D GRS,RES=(SYSDSN,datasetname)

and store the results in another dataset. The problem is that i didn't know a different way to do that. So, in the system that i am currently working there is that FINDQ CLIST that can be used to see the same information, but i don't think i can put the output in a stem. Can you tell me if there is any way to issue this console command via REXX and store the results in a dataset? I tried to use CONSOLE ACTIVATE and the GETMSG functions but no success. Can you tell me if it is possible to put the results of D GRS,RES=(SYSDSN,datasetname) console command in a stem(the result is more than 10 lines) so i can manipulate the information to store in a dataset?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Aug 27, 2010 12:56 am    Post subject: Reply to: How to parse results from ADDRESS TSO command
Reply with quote

If you're doing that from a console automation system, you should have no problem issuing a command and storing the results. If not, then you have to look into the product, or products, you use to manage your JES spool (SDSF, IOF, Sysview, $AVRS, etc.). I think all of them have an interface to the console, and will let you write code to issue the command and store the results.
Back to top
View user's profile Send private message
siebertr

New User


Joined: 25 Aug 2010
Posts: 7
Location: Brazil, Sao Paulo, Hortolandia

PostPosted: Fri Aug 27, 2010 12:56 am    Post subject:
Reply with quote

hey - i just found out how to do that!


ADDRESS TSO 'CONSPROF SOLDISPLAY(NO)'
ADDRESS TSO 'CONSOLE ACTIVATE'

/* ADDRESS CONSOLE 'D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB)*/
ADDRESS CONSOLE 'D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB)'

/* RETRIEVE OUTPUT COMMAND */
DO FOREVER
FC = GETMSG('LINE.','SOL',,,10)
IF FC = 0 THEN LEAVE
END
ADDRESS TSO 'CONSOLE DEACTIVATE'

with this code, i can store the output of console command D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB) in the stem LINE. [icon_biggrin.gif]
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Aug 27, 2010 2:50 am    Post subject: Reply to: How to parse results from ADDRESS TSO command
Reply with quote

Good to hear it is working - thank you for posting the solution icon_smile.gif

d
Back to top
View user's profile Send private message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Fri Aug 27, 2010 2:58 am    Post subject: Reply to: How to parse results from ADDRESS TSO command
Reply with quote

Try this code:

Code:
CALL OUTTRAP 'USERDET.'             
ADDRESS TSO 'WHOIS '||USER           
CALL OUTTRAP 'OFF'                   
IF USERDET.0 > 0 THEN DO             
  PARSE VAR USERDET.1 PART1 USER REST
  USER=STRIP(SUBSTR(USER,6,80))     
  SAY USER                           
  END                               
ELSE                                 
  USER=USERID()                     
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Vision results (also known as DYL-280) CaptBill CA Products 1 Tue Dec 20, 2016 3:35 am
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us