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



Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

Answer / mdv

Simple Sort job'll do.

Give PARM='nullout=rc4'

Is This Answer Correct ?    0 Yes 0 No

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

Answer / d

October_tare.pre-ounced soft continĂșe dis the great

Is This Answer Correct ?    0 Yes 0 No

Is there a way to check for an empty file in JCL other than using IEBCOMPR and the command PRINT C..

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

How can the attributes of one sms dataset be copied to another dataset?

0 Answers  


What is the difference between sb37,se37,sd37 each?

9 Answers   TCS,


how to concatenate datasets

5 Answers   EDS,


if in a job, region is mentioned in both jobcard and in step then which is cosidered at the step level? A job has region 4k in jobcard and step1 with region 0k and step2 with 16k, then what is the region allocated for the entire job? what is the region step1 takes? what is the region step2 takes?

4 Answers  


I have a File that has duplicate records. I need only those records that occur more than thrice.

3 Answers  






How different is the JCL executing a COBOL program? 1) if the program is using VB file as input. 2) if the program is using FB file as input.

1 Answers   HSBC,


what is the difference between JES3 and JES2?

0 Answers  


can we copy a file from fixed block to variable block and vice versa ....asap

1 Answers  


What is QSAM error usually when it is occurs?

1 Answers  


What will happen when we try to pass data from JCL to COBOL using PARM parameter without declaring the length field in Linkage Section?

2 Answers   IBM,


what is meant by jobtrac?

4 Answers   CSC,


what does mvs stand for?

1 Answers   IBM,


Categories