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

How to parse results from ADDRESS TSO command


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

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

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

Global Moderator


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

PostPosted: Wed Aug 25, 2010 9:39 pm
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: 8797
Location: Welsh Wales

PostPosted: Thu Aug 26, 2010 11:28 am
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
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

Global Moderator


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

PostPosted: Fri Aug 27, 2010 12:56 am
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
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

Moderator Emeritus


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

PostPosted: Fri Aug 27, 2010 2:50 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
Search our Forums:

Back to Top