How to check whether VSAM is empty or not



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to check whether VSAM is empty or not

Postby gauthamnagpur18 » Thu Sep 15, 2011 7:16 pm

Hi ,

How to check whether VSAM is empty or not? I know how to check for PS file. but i got stuck with VSAM .

Gautham
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times

Re: How to check whether VSAM is empty or not

 

Re: How to check whether VSAM is empty or not through JCl ?

Postby Robert Sample » Thu Sep 15, 2011 7:46 pm

How to check whether VSAM is empty or not through JCL ?
This at least partly depends upon what you mean by "empty". A VSAM file that has been defined but never loaded with any records cannot be opened for input -- period. A VSAM file that has been opened for output, had a record written to it, then closed -- even if the record is then deleted -- can be opened for input.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: How to check whether VSAM is empty or not through JCl ?

Postby gauthamnagpur18 » Thu Sep 15, 2011 7:55 pm

My Vsam file contains no records .

Thanks,
Gautham
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times

Re: How to check whether VSAM is empty or not

Postby BillyBoyo » Thu Sep 15, 2011 9:44 pm

Have you tried an IDCAMS LISTCAT for the dataset?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: How to check whether VSAM is empty or not

Postby Robert Sample » Thu Sep 15, 2011 11:28 pm

My Vsam file contains no records .
This may be accurate, but it is completely nonresponsive. A VSAM (note that VSAM is an acronym and should be capitalized in English) file that has no records either (1) has never had any records, or (2) had at least one record that was deleted. For case (1), you must use IDCAMS to do a LISTCAT command on the data set and parse the output looking for the record count -- or use a similar method using the product of your choice -- since you absolutely, positively cannot open the file for input to count the records. For case (2), you can use the utility of your choice to copy the file to a DUMMY data set and get the count of copied records.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: How to check whether VSAM is empty or not

Postby gauthamnagpur18 » Thu Sep 15, 2011 11:31 pm

Hi BillyBoyo,

Ya , i know that command . But is it possible through JCl ?

Hi Robert Sample ,

Using flat file we can do .. but my doubt was whether we can check VSAM is empty or not through JCL. :roll:

Thanks ,
Gautham
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times

Re: How to check whether VSAM is empty or not

Postby dick scherrer » Thu Sep 15, 2011 11:52 pm

Hello,
Ya , i know that command . But is it possible through JCl ?

Using flat file we can do .. but my doubt was whether we can check VSAM is empty or not through JCL.


NO and NO. . .JCL can do nothing execpt execute programs/procedures. What you can do is have JCL execute IDCAMS to see the record count.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: How to check whether VSAM is empty or not

Postby gauthamnagpur18 » Fri Sep 16, 2011 12:00 am

Hi dick scherrer,

You mean we can check record count of VSAM cluster ? wow ... it's done .. if record count is zero then its empty .

Thank you . I will try and let you know .

Thanks,
Gautham
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post