Verify whether a dataset is empty.

How do you verify whether a dataset is empty using a JCL?

Questions by mohammadanis.jamadar   answers by mohammadanis.jamadar

Showing Answers 1 - 5 of 5 Answers

Ashish Jain

  • Jun 4th, 2012
 

JCL to find if a dataset is empty
In your batch job, if there is a need to check for empty dataset, you can do it using IDCAMS.

Code
  1.  


Tarun

  • Jun 6th, 2012
 

Use IDCAMS to print the records present in dataset.
If present, the job will end with MAXCC 0000 otherwise MAXCC 0004 i.e. empty file.

Thanks,
Tarun

  Was this answer useful?  Yes

Rishu

  • Jul 28th, 2014
 

There are three ways to check if file is empty or not.
1:- Through IDCAMS, it is already explained above.
2:- Through ICETOOL, it is also explained above.
3:- Through SORT::
OPTION COPY
OUTFIL NULLOFL = RC12
When file is null then only return code is set to null.

  Was this answer useful?  Yes

Nagaraju

  • May 12th, 2017
 

using IDCAMS along with PRINT parameter.
It returns 0 data available in file.
It returns 4 data not available in file

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions