Is there a way to check for an empty file in JCL other than
using IEBCOMPR and the command PRINT COUNT(1)?




Answers were Sorted based on User's Feedback



Answer / jayaprabhu

using the Uitility IEBPTPCH

If RC=04 no data ie the file is empty
rc=00 file is not empty

Is This Answer Correct ?    12 Yes 1 No

Answer / arul anand.a

//STEP01 EXEC PGM=IDCAMS
//SYSUDUMP DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//INDD DD DSN=FILE1,
// DISP=SHR
//OUTDD DD DSN=FILE2,
// DISP=SHR,
REPRO INFILE(INDD) OUTFILE(OUTDD) COUNT(1)

THIS WILL GIVE RC = 04 IF THE INFILE IS EMPTY.
OTHERWISE IT WILL GIVE 0.

Is This Answer Correct ?    10 Yes 1 No

Answer / saikat

By using a simple selcopy we can determine whether the file
is empty or not. IF file is empty then we can set the
return code of the step in the selcopy code.

Is This Answer Correct ?    2 Yes 0 No




Answer / arun

Use the SORT utility with NULLOUT=RC04 OR RC16..If the file
is empty the step returns either 04 or 16 depending on what
you coded.

Is This Answer Correct ?    2 Yes 0 No

Answer / nbohr02

By adding an ICETOOL (DFSORT) step you can force a return
code on empty with the COUNT (dd) EMPTY this will set RC to
12 so your Batch scheduler may not like it.

Is This Answer Correct ?    3 Yes 2 No

Answer / mdv

Simple Sort job'll do.

Give PARM='nullout=rc4'

Is This Answer Correct ?    0 Yes 0 No

Answer / d

October_tare.pre-ounced soft continúe dis the great

Is This Answer Correct ?    0 Yes 0 No

Answer / nbohr02

You could write a REXX EXEC to read your required files then
have the exec sumbit the job to the internal reader with
either omitted steps or condition step coding. The IEBPTPCH
technique will work too.

Is This Answer Correct ?    0 Yes 3 No

Post New Answer



More JCL Interview Questions

Hi Guyz, My requirement is to empty out a PS file but not to delete. How would I do that. Is there any Utility. If any other way, plz answer. Thanks.

9 Answers   iGate, Lehman Brothers,


what are the technical terms for // /* in jcl

3 Answers   Cap Gemini,


If a jcl has just 1 step and the input file to this does not exist, then what will happen if we submit this job?

3 Answers  


what is a cataloged procedure ?

1 Answers   Xansa,


How to submit multiple jobs. These jobs are members in PDS. The second job should run if the first job runs successfully and so on.

1 Answers  






diff bw SB37,SD37,SE37 ?( bcz these 3 belongs Space related abends only)

4 Answers   RBS,


hi,i have joined in mainframe course recently. ihave a doubt ragarding restart parameter.what is d use of it. and what is d syntax for it. any one give me d answer pls.

3 Answers  


How system will identify whether user wants to create PS or PDS? If answer is SPACE parameter then why we need to pass ps or po as dataset organisation while creation

1 Answers  


what is the compile process of cobol program expalin with code

0 Answers   IBM,


do we need to mention the location of catalogued procedure for each it's call in a single job?

1 Answers  


What is the use of the utility DFSRRC00 in the JCL?

2 Answers   Convergys,


What is the difference between these two parameters? -> accounting information -> class how would it bring the differrence to a program?

4 Answers  






Categories