How to check an empty file in JCL



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

How to check an empty file in JCL

Postby madhavan » Fri Mar 16, 2012 6:23 pm

How to check an empty file in jCL?
madhavan
 
Posts: 23
Joined: Fri Mar 09, 2012 11:03 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to check an empty file in JCL

 

Re: JCL

Postby enrico-sorichetti » Fri Mar 16, 2012 6:46 pm

don' t You think it would have been more intelligent to use a more descriptive title :?: :evil:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2648
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 132 times

Re: JCL

Postby BillyBoyo » Fri Mar 16, 2012 6:52 pm

And to specify more exactly what you want to do? What type of dataset? How might it become empty? How is it created?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: JCL

Postby Robert Sample » Fri Mar 16, 2012 7:44 pm

Check it for what? As the others stated, your post lacks almost ALL information needed to answer your question. Data sets can be sequential, partitioned, indexed, direct, VSAM (ESDS, KSDS, RRDS, LDS), on disk or tape, and so forth.
Robert Sample
Global moderator
 
Posts: 3375
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 224 times

Re: How to check an empty file in JCL

Postby Frank Yaeger » Fri Mar 16, 2012 10:42 pm

madhavan,

Depending on exactly what you want to do, the "Set RC of 12, 8 or 4 if file is empty, has more than n records, etc ​" Smart DFSORT Trick at:

http://www.ibm.com/support/docview.wss? ... g3T7000094

might have the answer you're looking for. If not, you'll need to do a much better job of describing what it is you want to do exactly.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: How to check an empty file in JCL

Postby madhavan » Sat Mar 17, 2012 2:56 pm

I want to check whether the input dataset is empty or not
madhavan
 
Posts: 23
Joined: Fri Mar 09, 2012 11:03 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to check an empty file in JCL

Postby BillyBoyo » Sat Mar 17, 2012 4:23 pm

Then try what Frank has suggested, it should, with or without amendments to the example, do what you want.

My worry is that you might mean one thing by "empty" and actually having a different situation. But, if you are unwilling to be accurate, you are now left to find that out for yourself. I hope that you and the system agree on terminology.
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 an empty file in JCL

Postby steve-myers » Sun Mar 18, 2012 1:02 am

JCL, by itself, cannot determine if a dataset is "empty." The term "empty" has several possible meanings.
  • A sequential dataset
    • Has no data. A program must open and read the dataset, and report 0 records.
    • Is on disk and has never been written to. A program must analyze the dataset label. Many times a program will open and then close the dataset, and the label will effectively report the dataset is "empty," but that is not a guarantee.
  • A PDS
    • Has no members. A program must analyze the directory, and report there are no members.
    • A PDS member has no data. A program must open the member and report it has no data, just like a sequential dataset.
  • Any other kind of dataset. Here "empty" is basically meaningless.
Do not ever forget that the purpose of JCL is to define an environment for a program.
steve-myers
Global moderator
 
Posts: 1887
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 198 times

Re: How to check an empty file in JCL

Postby madhavan » Tue Mar 20, 2012 10:37 am

Thanks
madhavan
 
Posts: 23
Joined: Fri Mar 09, 2012 11:03 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to check an empty file in JCL

Postby pushkal2gud » Sat Apr 28, 2012 11:21 am

U can use IDCAMS or ICETOOL for it and read the records in the file.
pushkal2gud
 
Posts: 15
Joined: Fri Apr 20, 2012 7:13 pm
Has thanked: 0 time
Been thanked: 0 time

Next

Return to JCL

 


  • Related topics
    Replies
    Views
    Last post