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

To trap the jobs using a member to a dataset


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

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon Mar 09, 2009 2:25 pm
Reply with quote

Hi friends,
I want to trap the users/jobs using these 2 datasets and eliminate the duplicates and put it in to a dataset.
I generally use
TSO WHOHAS 'TEST.DATASET1'
TSO WHOHAS 'TEST.DATASET2'
seperately to just display the data but I tried to trap the data using OUTTRAP, it not trapping.

So, is there any other method where we can trap the output of 'WHOHAS' command?
or
Is there any other method to get the users holding the datasets and write it to an flat file?

Thanks,
Balu
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Mar 09, 2009 3:13 pm
Reply with quote

Take a look at the ISPF service QUERYENQ.

O.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Mon Mar 09, 2009 5:37 pm
Reply with quote

Thanks for the quick response.
I went thru the link provided above
I found it very useful and I have coded as follows:

Code:

/*rexx*/                                                     
MINOR = 'TEST.DATASET1'                                     
ASN = 'C'                                                   
ASNAME = ASN'*'                                             
ENQ = 'ENQ1'                                                 
MAJOR = '*'                                                 
ADDRESS  ISPEXEC                                             
"QUERYENQ  TABLE(QUERYENQ) QNAME(MAJOR) RNAME(MINOR) XSYS", 
"REQ("ASNAME")  SAVE("ENQ")"                                 
IF RC = 0 THEN                                               
"TBEND QUERYENQ"                                             
exit                                                         


This is working fine but it is displaying the jobs/ids used only in TSOP4(I have executed from TSOP4 only). If an user is using the dataset from TSOP3 it is not writing to the dataset.
One output record looked something like this:
Code:

CGPO     GHP4     SHARE OWN  SYSTEMS         GLOBAL         SYSDSN   'TEST.DATASET1'                                       


'TSO WHOHAS' is showing more no of ids than this.
I think GHP4 is representing the system, which is for TSOP4.
All the records in the output file are GHP4.
If I need the users using in GHP3 also
what modifications needed to the above code to get the desired result.



Regards,
Balu
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 10, 2009 2:33 am
Reply with quote

Just guessing... your WHOHAS probably does not filter by job name, whereas your QUERYENQ is filtering by job name. Trying removing the REQ("ASNAME") parameter.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Tue Mar 10, 2009 10:52 am
Reply with quote

I am not exactly sure how 'WHOHAS' works, but it is showing all the users using the dataset (either from TSOP4/TSOP3)

But the above code what I gave is showing only the ids in TSOP4

I have tried by removing the REQ parameter, but didn't work!
I don't thing REQ("ASNAME") will make any impact, as it will just limit the ENQ search to specific requesters.

Thanks,
Balu
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Tue Mar 10, 2009 4:42 pm
Reply with quote

I have done more analysis and found the following:
The parameter 'XSYS' which will get the ENQs on other systems is not functioning as expected.

When I ran the macro(mentioned above) in TSOP4.
Retrun code: 0
It is not displaying the ENQ from other systems(TSOP3).

But When I ran the same the macro in TSOP3.
Retrun code: 2
and it is displaying all the ENQ from other systems also(TSOP4).

My question is why is the macro not working fine in TSOP4 which is working perfectly in TSOP3.

Please let me know if any thing wrong and what needs to be done to get it right?

Regards,
Balu
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Mar 11, 2009 12:57 am
Reply with quote

Did you check the meaning of the return codes? The return codes are documented in ISPF Services Guide.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Wed Mar 11, 2009 8:43 am
Reply with quote

Yaa I checked..

RC 0: It may not reflect all ENQs on all systems.
RC 2: Data set written

When in TSOP3 --> RC 2 --> Writing all data
When in TSOP4 --> RC 0 --> Not writing all data, happens when XSYS is not specified. But I have specified.

Retrun codes are showing up properly, but why is the return code '0' in TSOP4

Thanks,
Balu
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Mar 11, 2009 9:22 pm
Reply with quote

My book also mentions something about the system running in STAR mode... not sure what that means, but make sure your IPL parameters for GRS are similar on both systems.

Quote:
I have tried by removing the REQ parameter, but didn't work!
I don't thing REQ("ASNAME") will make any impact, as it will just limit the ENQ search to specific requesters.

"didn't work" is not very detailed debugging information.

I think you are complaining that the lists returned are not the same, which is exactly what filtering will do. Please confirm that you are no long specifying REQ() parameter.
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Thu Mar 12, 2009 11:36 am
Reply with quote

Hi
REQ("ASNAME") : Is filtering the ENQ list based on the Job Name. when I gave ASNAME = C'*', it is displaying only the jobs stating with 'C'.
But still I have removed that REQ() parameter and tested.

By basic problem here is
the same REXX code is giving differet results in TSOP3 and TSOP4.
TSOP3 - Jobs from all the systems(P3 and P4).
TSOP4 - Jobs only from TSOP4.
Quote:
system running in STAR mode

Even I am not aware of it. May be some thing to do with this.
Quote:
make sure your IPL parameters for GRS..

How to check these IPL parameters, I am not sure. Please help me.

Thanks,
Balu
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 FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top