View previous topic :: View next topic
|
Author |
Message |
siebertr
New User
Joined: 25 Aug 2010 Posts: 7 Location: Brazil, Sao Paulo, Hortolandia
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Look at OUTTRAP. |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Never tried it, but will OUTTRAP trap output from a CLIST? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
siebertr
New User
Joined: 25 Aug 2010 Posts: 7 Location: Brazil, Sao Paulo, Hortolandia
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
siebertr
New User
Joined: 25 Aug 2010 Posts: 7 Location: Brazil, Sao Paulo, Hortolandia
|
|
|
|
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. [] |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good to hear it is working - thank you for posting the solution
d |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
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 |
|
|
|