MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VSAM Dataset usage history

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management
View previous topic :: View next topic  
Author Message
abhisun
Beginner


Joined: 20 Nov 2003
Posts: 21
Topics: 9

PostPosted: Mon May 17, 2004 1:26 am    Post subject: VSAM Dataset usage history Reply with quote

Hello Folks,

One of my production job abended because it could not open a VSAM dataset. That dataset was in use by some other production job at that point of time.

Now I want to know which job was using that dataset ? Is there a way to find out which job(s) accessed a VSAM dataset in past ?

PS- reg. current usage, I know that we can find the name of the job(s) using TSO WHOHAS or TSODSN command.

Thanks!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon May 17, 2004 5:05 am    Post subject: Reply with quote

abhisun,


Check your system log and you should be able to find the job who had the vsam dataset.

Another way round is you know the run time of your job. so if this is a scheduled environment then check the jobs which ran around the same time and see if they are accessing the same file.

If you have ca-7 then there is an option to list the dataset contentions

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abhisun
Beginner


Joined: 20 Nov 2003
Posts: 21
Topics: 9

PostPosted: Mon May 17, 2004 5:38 am    Post subject: Reply with quote

Thanks a lot Kolusu!

I already tried #2 option but no luck! and am still looking for that CA-7 option.

Can you please let me know how to access the system logs ?

Thanks again for your help!
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon May 17, 2004 8:14 am    Post subject: Reply with quote

Abhisun,

You can access your syslog from SDSF .
Code:

S;LOG


This will be your current log. Most shops usually back up their log , so with your systems programmer about archived log.



If you have access to ca-7 then type the following command at the command prompt.

Code:

LDSN,DSN=YOUR.FILE.NAME,LIST=USERS


Note that this command does not show if CICS is holding the dataset. So you need to check if this file is allocated to CICS. You can check it with CEMT command.

Code:

CEMT I FI('YOUR VSAM FILE DD NAME')


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
abhisun
Beginner


Joined: 20 Nov 2003
Posts: 21
Topics: 9

PostPosted: Tue May 18, 2004 12:45 am    Post subject: Reply with quote

Thanks Kolusu ! great piece of information

unfortunately I do not have access to see LOGs. Sad
Back to top
View user's profile Send private message
zoobink
Beginner


Joined: 01 Feb 2004
Posts: 9
Topics: 1

PostPosted: Tue May 18, 2004 2:21 am    Post subject: Reply with quote

All VSAM accesses should be logged in SMF records.
Record Type 62 (3E) -- VSAM Component or Cluster Opened
Back to top
View user's profile Send private message
souvik_225
Beginner


Joined: 15 May 2004
Posts: 17
Topics: 2
Location: Mumbai , India

PostPosted: Tue May 18, 2004 7:16 am    Post subject: Reply with quote

Abhisun,

You said that "One of my production job abended because it could not open a VSAM dataset. That dataset was in use by some other production job at that point of time. " ... if you look into the joblog of ur abended production job , I am sure you will get to see a contention error message(in my shop it shows the User id or Production/Test JOb name with which it was having contention).

Also it is good practise to use the LISTCAT option in a step previous to running your update Job , as such the job will go into hold and not abend( I am assuming that second Job was updating the same VSAM file, otherwise the second job would have automatically gone into a wait state)
_________________
Thanks and Regards,
Souvik Upadhyay
Back to top
View user's profile Send private message Yahoo Messenger
zoobink
Beginner


Joined: 01 Feb 2004
Posts: 9
Topics: 1

PostPosted: Tue May 18, 2004 7:31 am    Post subject: Reply with quote

Quote:

my shop it shows the User id or Production/Test JOb name with which it was having contention


I haven't seen this before. It must be a site specific exit.

Quote:

Also it is good practise to use the LISTCAT option in a step previous to running your update Job , as such the job will go into hold and not abend


This statement is incorrect. LISTCAT wont try to issue ENQ or RESERVE on the dataset.

Why not code DISP=OLD in the JCL?
Back to top
View user's profile Send private message
souvik_225
Beginner


Joined: 15 May 2004
Posts: 17
Topics: 2
Location: Mumbai , India

PostPosted: Tue May 18, 2004 7:49 am    Post subject: Reply with quote

Hi zoobink,
Say we have a job A running at step 10 which is updating the VSAM file ABC.KSDS.VSAM .

Now say we have job B starting where we have step 10 , which has :
//step10 EXEC PGM=IDCAMS
//SYSIN DD *
LISTCAT LEVEL(ABC.KSDS.VSAM) ALL
//SYSPRINT DD SYSOUT=*

and step 20 has a program which will also be updating the same VSAM file.

Now isn't it that step10 of Job B will go into hold and hence stop the execution of step 20 of job B??? Please correct me if I am wrong , as this is what there is in my production jobs ...
_________________
Thanks and Regards,
Souvik Upadhyay
Back to top
View user's profile Send private message Yahoo Messenger
zoobink
Beginner


Joined: 01 Feb 2004
Posts: 9
Topics: 1

PostPosted: Tue May 18, 2004 7:58 am    Post subject: Reply with quote

No,

The LISCAT command only retrieves information from the CATALOG and VVDS.

It doesn't perform any RESERVE or ENQ.

The two programs can and should be written so that ENQ and DEQ functions are handled within the two programs to avoid corruption, but the LISTCAT has no effect.
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Tue May 18, 2004 9:03 pm    Post subject: Reply with quote

As identified, allocating your VSAM file with DISP=OLD will cause your job to wait until the VSAM file is available (if it is held by another job or user).

If if you could use LISTCAT (which you can't), logically it would only enqueue the dataset for as long as it took to do the LISTCAT which wouldn't prevent others from enqueueing it in the meantime. Since LISTCAT doesn't enqueue anyway you are wasting your time.

To find out who has the file you need to try what has already been suggested, either yourself or through one of your system programmers, ie:

* SDSF Log
* SMF records

If you really get desperate you could even use RACF to alert you every time the file is accessed - that is of course if you own the file to begin with.

Out of interest, are you a JES2 or JES3 site?
_________________
My opinions are exactly that.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Data Management All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group