Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To trap the jobs using a member to a dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: To trap the jobs using a member to a dataset
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: 2360
Location: Israel

PostPosted: Mon Mar 09, 2009 3:13 pm    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Tue Mar 10, 2009 2:33 am    Post subject: Reply to: To trap the jobs using a member to a dataset
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Mar 11, 2009 12:57 am    Post subject: Reply to: To trap the jobs using a member to a dataset
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    Post subject:
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

Senior Member


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

PostPosted: Wed Mar 11, 2009 9:22 pm    Post subject: Reply to: To trap the jobs using a member to a dataset
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us