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

JCL to Verify Empty datsets


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Wed Aug 07, 2013 3:53 pm
Reply with quote

Hi ,

I have a Requirement to verify lot of datasets whether its empty or not , If its Empty we need to populate a message to output dataset saying this particular dataset is empty

Thanks
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Wed Aug 07, 2013 4:19 pm
Reply with quote

JCL cannot do this, of course; you'll need a program -- one that you have written or a utility. Do you have a preference?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Wed Aug 07, 2013 4:33 pm
Reply with quote

Program or utility anything is fine

Could you please share
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Aug 07, 2013 4:36 pm
Reply with quote

And are there any particular formats of dataset to be considered here, KSDS, ESDS, PDS, PS, DA, SAS ............ et al

You want to insert a record into the dataset saying that the dataset is empty ?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Wed Aug 07, 2013 4:42 pm
Reply with quote

All the datasets are PS Formats ,

say i have 5 datasets and out of which 1 datasets are empty means ,

Example:
1st dataset name : aaa.bbb
2nd dataset name : ccc.ddd -> empty dataset
3rd dataset name : eee.fff
4th dataset name : ggg.hhh
5th dataset name : iii.jjj

Output dataset should have a message

ccc.ddd is empty
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8796
Location: Welsh Wales

PostPosted: Wed Aug 07, 2013 4:49 pm
Reply with quote

Which output dataset are you talking about. Are you talking about a dataset completely different to those being tested, or are you suggesting that each empty dataset is then populated with a record saying that it is empty.

I would also be interested in knowing why you, or anyone else, would want this information.

Also you have not answered my question about dataset formats being interogated.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Wed Aug 07, 2013 5:05 pm
Reply with quote

raj4neo, what you want to do may not be possible. For example, if these files are VSAM KSDS files that have never had a record in them, you cannot open them for input or I-O and hence you could not determine that they are empty via a program.

Furthermore, I find the original premise very suspect -- in a well-designed system there would never be a question about whether a particular file (or files) is (are) empty since the well-designed system simply would process either way.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1787
Location: Bloomington, IL

PostPosted: Wed Aug 07, 2013 5:13 pm
Reply with quote

Robert Sample wrote:
For example, if these files are VSAM KSDS files that have never had a record in them, you cannot open them for input or I-O and hence you could not determine that they are empty via a program.


Is that necessarily the case? Could not one trap the file status and determine that the data set is uninitialized (as distinct from merely empty)?
Back to top
View user's profile Send private message
raj4neo
Warnings : 1

New User


Joined: 12 May 2006
Posts: 51
Location: India

PostPosted: Wed Aug 07, 2013 5:29 pm
Reply with quote

All the datasets i need to verify empty are PS ( Sequential datasets ) ,
NO VSAM datasets

Lot of Sequential datasets are coming from a vendor through File transfer , Now we are manually checking what are all empty datasets and sending a email to them saying these are empty ..

So our aim is to if we have a any job which can identify empty datasets and Write that dataset name in another dataset
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Aug 07, 2013 5:35 pm
Reply with quote

Just curious why dont you check the empty file and set the return code to non-Zero and trigger a mail
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed Aug 07, 2013 5:38 pm
Reply with quote

unfortunately the topic belongs to the category ...

Topics Not Eligible to Discuss in our Forum
ibmmainframes.com/viewtopic.php?t=20820&highlight=

item ...
How to check for empty dataset/file. This topic has already been posted many times. Please search for the answer that best suits your needs.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1744
Location: Tirupur, India

PostPosted: Wed Aug 07, 2013 5:43 pm
Reply with quote

9 ways to check empty file
- Credits to Stefan
docs.google.com/document/d/1MwkNFN0eH6mmhjAArAFTPg0uOUFcZPu2RvzPV1T2Amw/edit
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Email attachment from mainframe is empty PC Guides & IT News 9
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts EMPTY file check scenario JCL & VSAM 6
No new posts icetool empty file and not empty file... DFSORT/ICETOOL 5
Search our Forums:

Back to Top